summaryrefslogtreecommitdiff
path: root/lib/chef/run_context.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/run_context.rb')
-rw-r--r--lib/chef/run_context.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb
index 5d29f766c9..0ebf1b228d 100644
--- a/lib/chef/run_context.rb
+++ b/lib/chef/run_context.rb
@@ -85,6 +85,19 @@ class Chef
attr_reader :parent_run_context
#
+ # The root run context.
+ #
+ # @return [Chef::RunContext] The root run context.
+ #
+ def root_run_context
+ rc = self
+ until rc.parent_run_context.nil?
+ rc = rc.parent_run_context
+ end
+ rc
+ end
+
+ #
# The collection of resources intended to be converged (and able to be
# notified).
#