Method: Chef::RunStatus#to_h

Defined in:
lib/chef/run_status.rb

#to_hObject Also known as: to_hash

A Hash representation of the RunStatus, with the following (Symbol) keys:

  • :node

  • :success

  • :start_time

  • :end_time

  • :elapsed_time

  • :all_resources

  • :updated_resources

  • :exception

  • :backtrace



102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/chef/run_status.rb', line 102

def to_h
  # use a flat hash here so we can't errors from intermediate values being nil
  { node: node,
    success: success?,
    start_time: start_time,
    end_time: end_time,
    elapsed_time: elapsed_time,
    all_resources: all_resources,
    updated_resources: updated_resources,
    exception: formatted_exception,
    backtrace: backtrace,
    run_id: run_id }
end