class Chef::RunContext

Public Instance Methods

add_delayed_action(notification) click to toggle source
# File files/lib/chef_compat/monkeypatches/chef/run_context.rb, line 58
def add_delayed_action(notification)
  if delayed_actions.any? { |existing_notification| existing_notification.duplicates?(notification) }
    Chef::Log.info( "#{notification.notifying_resource} not queuing delayed action #{notification.action} on #{notification.resource}"\
                   " (delayed), as it's already been queued")
  else
    delayed_actions << notification
  end
end
create_child() click to toggle source
# File files/lib/chef_compat/monkeypatches/chef/run_context.rb, line 69
def create_child
  result = dup
  result.parent_run_context = self
  result.initialize_child_state
  result
end
delayed_actions() click to toggle source
# File files/lib/chef_compat/monkeypatches/chef/run_context.rb, line 36
def delayed_actions
  @delayed_actions ||= []
end
initialize_child_state() click to toggle source

Copied verbatim from 12.10.24 Chef::RunContext

# File files/lib/chef_compat/monkeypatches/chef/run_context.rb, line 45
def initialize_child_state
  @audits = {}
  @resource_collection = Chef::ResourceCollection.new(self)
  @before_notification_collection = Hash.new { |h, k| h[k] = [] }
  @immediate_notification_collection = Hash.new { |h, k| h[k] = [] }
  @delayed_notification_collection = Hash.new { |h, k| h[k] = [] }
  @delayed_actions = []
end