summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-06-08 09:09:31 -0700
committerJohn Keiser <john@johnkeiser.com>2015-06-08 09:09:31 -0700
commit4936ddb3b2391a6cab7adf9f3883ab97a3c57272 (patch)
tree585dd1a1059552bca87c68689a564f8f6fa50134
parent2291299eb6519f484f3ca1c3e56ac444b7c50199 (diff)
downloadchef-4936ddb3b2391a6cab7adf9f3883ab97a3c57272.tar.gz
Make real exceptions, remove stray canonical argument
-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]))