Method: Chef::ResourceReporter#run_started

Defined in:
lib/chef/resource_reporter.rb

#run_started(run_status) ⇒ Object

[View source]

67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/chef/resource_reporter.rb', line 67

def run_started(run_status)
  @run_status = run_status

  if reporting_enabled?
    begin
      resource_history_url = "reports/nodes/#{node_name}/runs"
      server_response = rest_client.post(resource_history_url, { action: :start, run_id: run_id,
                                                                 start_time: start_time.to_s }, headers)
    rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e
      handle_error_starting_run(e, resource_history_url)
    end
  end
end