Skip to content

Commit

Permalink
CHEF-2676: ignore a duplication #update action, it should be idempote…
Browse files Browse the repository at this point in the history
…nt anyway.

In all likelihood this is just a client retrying after a timeout.
  • Loading branch information
Andrea Campi authored and danielsdeleo committed Oct 25, 2011
1 parent 173ec32 commit 7841661
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion chef-server-api/app/controllers/sandboxes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ def update
existing_sandbox = Chef::Sandbox.cdb_load(params[:sandbox_id])
raise NotFound, "cannot find sandbox with guid #{params[:sandbox_id]}" unless existing_sandbox

raise BadRequest, "cannot update sandbox #{params[:sandbox_id]}: already complete" if existing_sandbox.is_completed
if existing_sandbox.is_completed
Chef::Log.warn("Sandbox finalization: #{params[:sandbox_id]} is already complete, ignoring")
return display(existing_sandbox)
end

if params[:is_completed]
existing_sandbox.is_completed = (params[:is_completed] == true)
Expand Down

0 comments on commit 7841661

Please sign in to comment.