summaryrefslogtreecommitdiff
path: root/lib/chef/node.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-16 12:52:53 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-01-16 12:52:53 -0800
commit7c4670ce77cafb481477e9da75348a75b44c0393 (patch)
tree62a8d3a7ad3df821140911758d3743e98f62573f /lib/chef/node.rb
parentdbd925b357b036447b47cf5f369792f81d69e76d (diff)
downloadchef-7c4670ce77cafb481477e9da75348a75b44c0393.tar.gz
CHEF-4777: fix for fully qualifying recipes
this makes it so that the recipes in the attribute will be fully qualified, and will avoid the problem of both "cookbook" and "cookbook::default" showing up.
Diffstat (limited to 'lib/chef/node.rb')
-rw-r--r--lib/chef/node.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index eaae1ee148..69e5e05b01 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -249,8 +249,9 @@ class Chef
# used by include_recipe to add recipes to the expanded run_list to be
# saved back to the node and be searchable
- def loaded_recipe(recipe_name)
- automatic_attrs[:recipes] << recipe_name unless Array(self[:recipes]).include?(recipe_name)
+ def loaded_recipe(cookbook, recipe)
+ fully_qualified_recipe = "#{cookbook}::#{recipe}"
+ automatic_attrs[:recipes] << fully_qualified_recipe unless Array(self[:recipes]).include?(fully_qualified_recipe)
end
# Returns true if this Node expects a given role, false if not.