diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-12-07 13:42:39 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-12-07 13:42:39 -0800 |
commit | e921e921fbbd759b5dc43404b45f1dc198bd7417 (patch) | |
tree | 3445709ab2cea81e02ea8fbae436d0656cb1959c /lib/chef | |
parent | 1c9970d97b043e250b5d000ce2f581f4a7466e72 (diff) | |
download | chef-e921e921fbbd759b5dc43404b45f1dc198bd7417.tar.gz |
Properly deprecate old Chef::Platform methods
These should have been deprecated formally in 12.5.1 after the
Dynamic Provider-Resolver'ing of the internal chef resources
was completed.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/deprecated.rb | 10 | ||||
-rw-r--r-- | lib/chef/platform/provider_mapping.rb | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/chef/deprecated.rb b/lib/chef/deprecated.rb index de5090a48b..3a988fdfa3 100644 --- a/lib/chef/deprecated.rb +++ b/lib/chef/deprecated.rb @@ -156,6 +156,16 @@ class Chef end end + class ChefPlatformMethods < Base + def id + 13 + end + + def target + "chef_platform_methods.html" + end + end + class ResourceCloning < Base def id 3694 diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb index bc565d92ef..abab719688 100644 --- a/lib/chef/platform/provider_mapping.rb +++ b/lib/chef/platform/provider_mapping.rb @@ -35,6 +35,7 @@ class Chef include Chef::Mixin::ParamsValidate def find(name, version) + Chef.deprecated(:chef_platform_methods, "#{self.class.name}.find is deprecated") provider_map = platforms[:default].clone name_sym = name @@ -90,6 +91,7 @@ class Chef end def provider_for_resource(resource, action = :nothing) + Chef.deprecated(:chef_platform_methods, "#{self.class.name}.provider_for_resource is deprecated") node = resource.run_context && resource.run_context.node raise ArgumentError, "Cannot find the provider for a resource with no run context set" unless node provider = find_provider_for_node(node, resource).new(resource, resource.run_context) @@ -102,11 +104,13 @@ class Chef end def find_provider_for_node(node, resource_type) + Chef.deprecated(:chef_platform_methods, "#{self.class.name}.find_provider_for_node is deprecated") platform, version = find_platform_and_version(node) find_provider(platform, version, resource_type) end def set(args) + Chef.deprecated(:chef_platform_methods, "#{self.class.name}.set is deprecated") validate( args, { @@ -172,6 +176,7 @@ class Chef end def find_provider(platform, version, resource_type) + Chef.deprecated(:chef_platform_methods, "#{self.class.name}.find_provider is deprecated") provider_klass = explicit_provider(platform, version, resource_type) || platform_provider(platform, version, resource_type) || resource_matching_provider(platform, version, resource_type) |