summaryrefslogtreecommitdiff
path: root/lib/chef/provider.rb
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2017-04-03 17:23:10 -0500
committerNoah Kantrowitz <noah@coderanger.net>2017-04-03 17:23:10 -0500
commit9dc01eafb44618cb71169d8c891d3ce2792aed1f (patch)
tree21130bfc55193f42b6630387cdd458f34e0ee185 /lib/chef/provider.rb
parent1ffb0a0fa00f1ef359e42886def859df6fd3e48c (diff)
downloadchef-9dc01eafb44618cb71169d8c891d3ce2792aed1f.tar.gz
Try removing the const-ificiation of DSL-based resources/providers.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'lib/chef/provider.rb')
-rw-r--r--lib/chef/provider.rb27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index 8334eab0a6..ce2f431fec 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -432,33 +432,6 @@ class Chef
end
end
- module DeprecatedLWRPClass
- def const_missing(class_name)
- if Chef::Provider.deprecated_constants[class_name.to_sym]
- Chef.deprecated(:custom_resource, "Using an LWRP provider by its name (#{class_name}) directly is no longer supported in Chef 12 and will be removed. Use Chef::ProviderResolver.new(node, resource, action) instead.")
- Chef::Provider.deprecated_constants[class_name.to_sym]
- else
- raise NameError, "uninitialized constant Chef::Provider::#{class_name}"
- end
- end
-
- # @api private
- def register_deprecated_lwrp_class(provider_class, class_name)
- # Register Chef::Provider::MyProvider with deprecation warnings if you
- # try to access it
- if Chef::Provider.const_defined?(class_name, false)
- Chef::Log.warn "Chef::Provider::#{class_name} already exists! Cannot create deprecation class for #{provider_class}"
- else
- Chef::Provider.deprecated_constants[class_name.to_sym] = provider_class
- end
- end
-
- def deprecated_constants
- raise "Deprecated constants should be called only on Chef::Provider" unless self == Chef::Provider
- @deprecated_constants ||= {}
- end
- end
- extend DeprecatedLWRPClass
end
end