summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook_loader.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-07-02 14:55:20 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-07-02 15:08:43 -0700
commit21189d25a9385aa9ff3368716824b8333475a08b (patch)
treed4316d70ff88b5a43ffff90d04bd789da51cf9d4 /lib/chef/cookbook_loader.rb
parentfb6c052ae6d58db2499cf04ef0595d1e06a4c13c (diff)
downloadchef-21189d25a9385aa9ff3368716824b8333475a08b.tar.gz
fix Style/PreferredHashMethods
absolutely hard requirement on the fixes that went into chef-config 2.2.11, so the floor of that gem is bumped up. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/cookbook_loader.rb')
-rw-r--r--lib/chef/cookbook_loader.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/cookbook_loader.rb b/lib/chef/cookbook_loader.rb
index 1cd498496a..32fd71f604 100644
--- a/lib/chef/cookbook_loader.rb
+++ b/lib/chef/cookbook_loader.rb
@@ -93,7 +93,7 @@ class Chef
def load_cookbook(cookbook_name)
preload_cookbooks
- return @cookbooks_by_name[cookbook_name] if @cookbooks_by_name.has_key?(cookbook_name)
+ return @cookbooks_by_name[cookbook_name] if @cookbooks_by_name.key?(cookbook_name)
return nil unless @loaders_by_name.key?(cookbook_name.to_s)
@@ -112,7 +112,7 @@ class Chef
end
end
- if @loaded_cookbooks.has_key?(cookbook_name)
+ if @loaded_cookbooks.key?(cookbook_name)
cookbook_version = @loaded_cookbooks[cookbook_name].cookbook_version
@cookbooks_by_name[cookbook_name] = cookbook_version
@metadata[cookbook_name] = cookbook_version.metadata
@@ -121,7 +121,7 @@ class Chef
end
def [](cookbook)
- if @cookbooks_by_name.has_key?(cookbook.to_sym) || load_cookbook(cookbook.to_sym)
+ if @cookbooks_by_name.key?(cookbook.to_sym) || load_cookbook(cookbook.to_sym)
@cookbooks_by_name[cookbook.to_sym]
else
raise Exceptions::CookbookNotFoundInRepo, "Cannot find a cookbook named #{cookbook}; did you forget to add metadata to a cookbook? (https://docs.chef.io/config_rb_metadata.html)"