summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-05-06 14:24:00 -0700
committerJohn Keiser <john@johnkeiser.com>2015-05-13 13:43:14 -0700
commit2032c6776587f9450ddba182867973ab5bee1b75 (patch)
tree907d2c3a62a7dbafc78c26e7fd6d4677a9a8d3b4 /lib/chef/resource.rb
parentc0ab4749e58ad00a4ccbb397fc1cce8c9763370a (diff)
downloadchef-2032c6776587f9450ddba182867973ab5bee1b75.tar.gz
Fix deprecation warning (and corresponding test) for Chef::Resource::Blah
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 565313e3e1..d5a1876943 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -1129,13 +1129,12 @@ class Chef
# @deprecated Chef::Resource::FooBar will no longer mean anything special in
# Chef 13. Use `resource_for_node` instead.
def self.resource_matching_short_name(short_name)
- require 'chef/resource_resolver'
begin
rname = convert_to_class_name(short_name.to_s)
result = Chef::Resource.const_get(rname)
- if result.is_a?(Chef::Resource)
- Chef::Log.deprecation("Class Chef::Resource::#{rname} does not declare `provides #{short_name.inspect}`.")
- Chef::Log.deprecation("This will no longer work in Chef 13: you must use `provides` to provide DSL.")
+ if result <= Chef::Resource
+ Chef::Log.deprecation("Class Chef::Resource::#{rname} does not declare 'provides #{short_name.inspect}'.")
+ Chef::Log.deprecation("This will no longer work in Chef 13: you must use 'provides' to provide DSL.")
result
end
rescue NameError