summaryrefslogtreecommitdiff
path: root/lib/chef/run_context/cookbook_compiler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/run_context/cookbook_compiler.rb')
-rw-r--r--lib/chef/run_context/cookbook_compiler.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/chef/run_context/cookbook_compiler.rb b/lib/chef/run_context/cookbook_compiler.rb
index 0a05061152..abe5afa7ae 100644
--- a/lib/chef/run_context/cookbook_compiler.rb
+++ b/lib/chef/run_context/cookbook_compiler.rb
@@ -16,6 +16,7 @@
# limitations under the License.
#
+require 'set'
require 'chef/log'
require 'chef/recipe'
require 'chef/resource/lwrp_base'
@@ -149,6 +150,17 @@ class Chef
@events.recipe_load_complete
end
+ # Whether or not a cookbook is reachable from the set of cookbook given
+ # by the run_list plus those cookbooks' dependencies.
+ def unreachable_cookbook?(cookbook_name)
+ !reachable_cookbooks.include?(cookbook_name)
+ end
+
+ # All cookbooks in the dependency graph, returned as a Set.
+ def reachable_cookbooks
+ @reachable_cookbooks ||= Set.new(cookbook_order)
+ end
+
private
def load_attributes_from_cookbook(cookbook_name)