summaryrefslogtreecommitdiff
path: root/lib/chef/resource_resolver.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-04-20 16:42:19 -0700
committerJohn Keiser <john@johnkeiser.com>2015-05-13 13:42:33 -0700
commita379de8207f33938abac36cf415e0d593aa24d59 (patch)
treea270f524453d36bd4f0f4a0add4866119396b72d /lib/chef/resource_resolver.rb
parent644342358dcd7202c24f731eae498db1ec46db3d (diff)
downloadchef-a379de8207f33938abac36cf415e0d593aa24d59.tar.gz
Add provides_nothing and let it override even Chef::Resource::X automatic names
Diffstat (limited to 'lib/chef/resource_resolver.rb')
-rw-r--r--lib/chef/resource_resolver.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/chef/resource_resolver.rb b/lib/chef/resource_resolver.rb
index ac6b3d8839..e9aec11f62 100644
--- a/lib/chef/resource_resolver.rb
+++ b/lib/chef/resource_resolver.rb
@@ -105,10 +105,12 @@ class Chef
# to the list of handlers for next time.
resource_class = Chef::Resource.const_get(class_name)
if resource_class <= Chef::Resource && !enabled_handlers.include?(resource_class)
- Chef::Log.warn("Class #{resource_class} was created with Class.new and assigned directly to a constant (#{resource_class.name} = <class>) rather than being created directly (class #{resource_class.name} < <superclass>).")
- Chef::Log.warn("This will no longer work in Chef 13: you can either declare your class directly (in any namespace), or specify 'provides #{resource.to_sym.inspect}' in the class definition.")
- resource_class.provides resource.to_sym
enabled_handlers << resource_class
+ if resource_class.using_automatic_dsl?
+ Chef::Log.warn("Class #{resource_class} was created with Class.new and assigned directly to a constant (#{resource_class.name} = <class>) rather than being created directly (class #{resource_class.name} < <superclass>).")
+ Chef::Log.warn("This will no longer work in Chef 13: you can either declare your class directly (in any namespace), or specify 'provides #{resource.to_sym.inspect}' in the class definition.")
+ resource_class.provides resource.to_sym
+ end
end
end
end