def run_action(resource, action, notification_type=nil, notifying_resource=nil)
resource.run_action(action, notification_type, notifying_resource)
if resource.updated_by_last_action?
run_context.immediate_notifications(resource).each do |notification|
Chef::Log.info("#{resource} sending #{notification.action} action to #{notification.resource} (immediate)")
run_action(notification.resource, notification.action, :immediate, resource)
end
run_context.delayed_notifications(resource).each do |notification|
if delayed_actions.any? { |existing_notification| existing_notification.duplicates?(notification) }
Chef::Log.info( "#{resource} not queuing delayed action #{notification.action} on #{notification.resource}"\
" (delayed), as it's already been queued")
else
delayed_actions << notification
end
end
end
end