summaryrefslogtreecommitdiff
path: root/lib/chef/node_map.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/node_map.rb')
-rw-r--r--lib/chef/node_map.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb
index 9092316c1b..f07c44192f 100644
--- a/lib/chef/node_map.rb
+++ b/lib/chef/node_map.rb
@@ -75,9 +75,8 @@ class Chef
# @return [Object] Value
#
def get(node, key)
- # FIXME: real exception
- raise "first argument must be a Chef::Node" unless node.is_a?(Chef::Node) || node.nil?
- list(node, key, canonical: canonical).first
+ raise ArgumentError, "first argument must be a Chef::Node" unless node.is_a?(Chef::Node) || node.nil?
+ list(node, key).first
end
#
@@ -91,8 +90,7 @@ class Chef
# @return [Object] Value
#
def list(node, key)
- # FIXME: real exception
- raise "first argument must be a Chef::Node" unless node.is_a?(Chef::Node) || node.nil?
+ raise ArgumentError, "first argument must be a Chef::Node" unless node.is_a?(Chef::Node) || node.nil?
return [] unless @map.has_key?(key)
@map[key].select do |matcher|
!node || (filters_match?(node, matcher[:filters]) && block_matches?(node, matcher[:block]))