class Chef::ActionCollection::ActionRecord

Attributes

action[RW]

@return [Symbol] # The action that was run (or scheduled to run in the case of “unprocessed” resources).

after_resource[RW]

@return [Chef::Resource] the after_resource object (after-state). This can be nil for non custom-resources or resources that do not implement load_after_resource.

conditional[RW]

@return [Chef::Resource::Conditional] The conditional that caused the resource to be skipped

current_resource[RW]

@return [Chef::Resource] The current_resource object (before-state). This can be nil for non-why-run-safe resources in why-run mode, or if load_current_resource itself threw an exception (which should be considered a bug in that load_current_resource implementation, but must be handled), or for unprocessed resources.

elapsed_time[RW]

@return [Numeric] The elapsed time in seconds with machine precision

error_description[RW]

@return [Hash] JSON-formatted error description from the Chef::Formatters::ErrorMapper

exception[RW]

@return [Exception] The exception that was thrown

nesting_level[RW]

The “nesting” level. Outer resources in recipe context are 0 here, while for every sub-resource_collection inside of a custom resource this number is incremented by 1. Resources that are fired via build-resource or manually creating and firing

@return [Integer]

new_resource[RW]

@return [Chef::Resource] The declared resource state.

status[RW]

The status of the resource:

- updated:     ran and converged
- up_to_date:  skipped due to idempotency
- skipped:     skipped due to a conditional
- failed:      failed with an exception
- unprocessed: resources that were not touched by a run that failed

@return [Symbol] status

Public Class Methods

new(new_resource, action, nesting_level) click to toggle source
# File lib/chef/action_collection.rb, line 75
def initialize(new_resource, action, nesting_level)
  @new_resource = new_resource
  @action = action
  @nesting_level = nesting_level
end

Public Instance Methods

success?() click to toggle source

@return [Boolean] true if there was no exception

# File lib/chef/action_collection.rb, line 82
def success?
  !exception
end