summaryrefslogtreecommitdiff
path: root/lib/chef/node_map.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/node_map.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/node_map.rb')
-rw-r--r--lib/chef/node_map.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb
index 6496d91de7..62efbc12d6 100644
--- a/lib/chef/node_map.rb
+++ b/lib/chef/node_map.rb
@@ -138,7 +138,7 @@ EOH
# @return [Object] Class
#
def get(node, key, canonical: nil)
- return nil unless map.has_key?(key)
+ return nil unless map.key?(key)
map[key].map do |matcher|
return matcher[:klass] if node_matches?(node, matcher) && canonical_matches?(canonical, matcher)
end
@@ -158,7 +158,7 @@ EOH
# @return [Object] Class
#
def list(node, key, canonical: nil)
- return [] unless map.has_key?(key)
+ return [] unless map.key?(key)
map[key].select do |matcher|
node_matches?(node, matcher) && canonical_matches?(canonical, matcher)
end.map { |matcher| matcher[:klass] }