summaryrefslogtreecommitdiff
path: root/lib/chef/node.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2013-11-14 19:20:09 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2013-11-14 19:20:09 -0800
commitdbd925b357b036447b47cf5f369792f81d69e76d (patch)
tree31a50b87878057b04b3e75bc1615cd67b228d74c /lib/chef/node.rb
parentecbc917ac5496f3138b798332ea66f477c33f8ba (diff)
downloadchef-dbd925b357b036447b47cf5f369792f81d69e76d.tar.gz
CHEF-4777: add include_recipes to recipes node attr
Diffstat (limited to 'lib/chef/node.rb')
-rw-r--r--lib/chef/node.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index 007bd3c560..eaae1ee148 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -247,6 +247,12 @@ class Chef
run_list.include?(recipe_name) || Array(self[:recipes]).include?(recipe_name)
end
+ # 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)
+ end
+
# Returns true if this Node expects a given role, false if not.
def role?(role_name)
run_list.include?("role[#{role_name}]")