Class: Chef::ActionCollection::ActionRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/action_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(new_resource, action, nesting_level) ⇒ ActionRecord



75
76
77
78
79
# 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

Instance Attribute Details

#actionSymbol



42
43
44
# File 'lib/chef/action_collection.rb', line 42

def action
  @action
end

#after_resourceChef::Resource

non custom-resources or resources that do not implement load_after_resource.



39
40
41
# File 'lib/chef/action_collection.rb', line 39

def after_resource
  @after_resource
end

#conditionalChef::Resource::Conditional



54
55
56
# File 'lib/chef/action_collection.rb', line 54

def conditional
  @conditional
end

#current_resourceChef::Resource

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.



35
36
37
# File 'lib/chef/action_collection.rb', line 35

def current_resource
  @current_resource
end

#elapsed_timeNumeric



51
52
53
# File 'lib/chef/action_collection.rb', line 51

def elapsed_time
  @elapsed_time
end

#error_descriptionHash



48
49
50
# File 'lib/chef/action_collection.rb', line 48

def error_description
  @error_description
end

#exceptionException



45
46
47
# File 'lib/chef/action_collection.rb', line 45

def exception
  @exception
end

#nesting_levelInteger

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



73
74
75
# File 'lib/chef/action_collection.rb', line 73

def nesting_level
  @nesting_level
end

#new_resourceChef::Resource



29
30
31
# File 'lib/chef/action_collection.rb', line 29

def new_resource
  @new_resource
end

#statusSymbol

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


65
66
67
# File 'lib/chef/action_collection.rb', line 65

def status
  @status
end

Instance Method Details

#success?Boolean



82
83
84
# File 'lib/chef/action_collection.rb', line 82

def success?
  !exception
end