diff options
author | mmzyk <mmzyk@opscode.com> | 2013-04-26 01:13:07 -0400 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-06-18 08:58:18 -0700 |
commit | 520567084038491f398719c67fadefb316cd7a66 (patch) | |
tree | 28ac318d9472da8ea87e3df9db53507182c7aada | |
parent | 0e0339863da133aaf862ae0d503918d44bcf2055 (diff) | |
download | chef-520567084038491f398719c67fadefb316cd7a66.tar.gz |
[OC-7370] Rename node_run begin action to start
-rw-r--r-- | lib/chef/resource_reporter.rb | 8 | ||||
-rw-r--r-- | spec/unit/resource_reporter_spec.rb | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb index af9af65812..e078e88b1f 100644 --- a/lib/chef/resource_reporter.rb +++ b/lib/chef/resource_reporter.rb @@ -126,16 +126,16 @@ class Chef if reporting_enabled? begin resource_history_url = "reports/nodes/#{@node.name}/runs" - server_response = @rest_client.post_rest(resource_history_url, {:action => :begin, :run_id => @run_id, + server_response = @rest_client.post_rest(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_beginning_run(e, resource_history_url) + handle_error_starting_run(e, resource_history_url) end end end - def handle_error_beginning_run(e, url) - message = "Reporting error beginning run. URL: #{url} " + def handle_error_starting_run(e, url) + message = "Reporting error starting run. URL: #{url} " code = if e.response.code e.response.code.to_s else diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb index a59b0cfb75..389cc79c60 100644 --- a/spec/unit/resource_reporter_spec.rb +++ b/spec/unit/resource_reporter_spec.rb @@ -429,7 +429,7 @@ describe Chef::ResourceReporter do @response = Net::HTTPNotFound.new("a response body", "404", "Not Found") @error = Net::HTTPServerException.new("404 message", @response) @rest_client.should_receive(:post_rest). - with("reports/nodes/spitfire/runs", {:action => :begin, :run_id => @run_id, + with("reports/nodes/spitfire/runs", {:action => :start, :run_id => @run_id, :start_time => @start_time.to_s}, {'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION}). and_raise(@error) @@ -459,7 +459,7 @@ describe Chef::ResourceReporter do @response = Net::HTTPInternalServerError.new("a response body", "500", "Internal Server Error") @error = Net::HTTPServerException.new("500 message", @response) @rest_client.should_receive(:post_rest). - with("reports/nodes/spitfire/runs", {:action => :begin, :run_id => @run_id, :start_time => @start_time.to_s}, + with("reports/nodes/spitfire/runs", {:action => :start, :run_id => @run_id, :start_time => @start_time.to_s}, {'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION}). and_raise(@error) end @@ -489,7 +489,7 @@ describe Chef::ResourceReporter do @response = Net::HTTPInternalServerError.new("a response body", "500", "Internal Server Error") @error = Net::HTTPServerException.new("500 message", @response) @rest_client.should_receive(:post_rest). - with("reports/nodes/spitfire/runs", {:action => :begin, :run_id => @run_id, :start_time => @start_time.to_s}, + with("reports/nodes/spitfire/runs", {:action => :start, :run_id => @run_id, :start_time => @start_time.to_s}, {'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION}). and_raise(@error) end @@ -510,7 +510,7 @@ describe Chef::ResourceReporter do before do response = {"uri"=>"https://example.com/reports/nodes/spitfire/runs/@run_id"} @rest_client.should_receive(:post_rest). - with("reports/nodes/spitfire/runs", {:action => :begin, :run_id => @run_id, :start_time => @start_time.to_s}, + with("reports/nodes/spitfire/runs", {:action => :start, :run_id => @run_id, :start_time => @start_time.to_s}, {'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION}). and_return(response) @resource_reporter.run_started(@run_status) |