diff options
Diffstat (limited to 'lib/chef/resource_reporter.rb')
-rw-r--r-- | lib/chef/resource_reporter.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb index 19964c24cf..4135483441 100644 --- a/lib/chef/resource_reporter.rb +++ b/lib/chef/resource_reporter.rb @@ -121,8 +121,8 @@ class Chef 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) + 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 @@ -232,7 +232,7 @@ class Chef Chef::Log.debug("Sending compressed run data...") # Since we're posting compressed data we can not directly call post which expects JSON begin - @rest_client.raw_request(:POST, resource_history_url, headers({"Content-Encoding" => "gzip"}), compressed_data) + @rest_client.raw_request(:POST, resource_history_url, headers({ "Content-Encoding" => "gzip" }), compressed_data) rescue StandardError => e if e.respond_to? :response Chef::FileCache.store("failed-reporting-data.json", Chef::JSONCompat.to_json_pretty(run_data), 0640) @@ -247,7 +247,7 @@ class Chef end def headers(additional_headers = {}) - options = {"X-Ops-Reporting-Protocol-Version" => PROTOCOL_VERSION} + options = { "X-Ops-Reporting-Protocol-Version" => PROTOCOL_VERSION } options.merge(additional_headers) end @@ -282,7 +282,7 @@ class Chef exception_data["class"] = exception.inspect exception_data["message"] = exception.message exception_data["backtrace"] = Chef::JSONCompat.to_json(exception.backtrace) - exception_data["description"] = @error_descriptions + exception_data["description"] = @error_descriptions run_data["data"]["exception"] = exception_data end run_data @@ -319,7 +319,7 @@ class Chef def encode_gzip(data) "".tap do |out| - Zlib::GzipWriter.wrap(StringIO.new(out)){|gz| gz << data } + Zlib::GzipWriter.wrap(StringIO.new(out)) { |gz| gz << data } end end |