summaryrefslogtreecommitdiff
path: root/lib/chef/node.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-12-26 11:04:49 -0800
committerBryan McLellan <btm@opscode.com>2012-12-26 13:01:12 -0800
commitf132b98c4faddcaee5002105a6aa647bbb549c19 (patch)
tree91085a87a59f1c9148157d6917eca73e30319457 /lib/chef/node.rb
parent4f3ae7200f693b3c5ad7278534aa0844b1bd225d (diff)
downloadchef-f132b98c4faddcaee5002105a6aa647bbb549c19.tar.gz
[CHEF-3724] correctly query the recipes attribute in Node#recipe?
Also, coerce node[:recipes] to an Array so that Node#recipe? will work correctly when the recipes attribute has not been set.
Diffstat (limited to 'lib/chef/node.rb')
-rw-r--r--lib/chef/node.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index d079c8aeff..a2bffcc172 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -241,7 +241,7 @@ class Chef
#
# NOTE: It's used by cookbook authors
def recipe?(recipe_name)
- run_list.include?(recipe_name) || self[recipes].include?(recipe_name)
+ run_list.include?(recipe_name) || Array(self[:recipes]).include?(recipe_name)
end
# Returns true if this Node expects a given role, false if not.