diff --git a/lib/docker/connection.rb b/lib/docker/connection.rb index 2e1a0516a..da1fb192d 100644 --- a/lib/docker/connection.rb +++ b/lib/docker/connection.rb @@ -77,7 +77,7 @@ def compile_request_params(http_method, path, query = nil, opts = nil, &block) :headers => { 'Content-Type' => content_type, 'User-Agent' => user_agent, }.merge(headers), - :expects => (200..204), + :expects => (200..204).to_a << 304, :idempotent => http_method == :get, :request_block => block }.merge(opts).reject { |_, v| v.nil? } diff --git a/lib/docker/container.rb b/lib/docker/container.rb index ea293f490..daebe882e 100644 --- a/lib/docker/container.rb +++ b/lib/docker/container.rb @@ -26,7 +26,7 @@ def wait(time = nil) # UnexpectedResponseError is raised. def run(cmd, time = 1000) if (code = tap(&:start).wait(time)['StatusCode']).zero? - commit.run(cmd).tap(&:start) + commit.run(cmd) else raise UnexpectedResponseError, "Command returned status code #{code}." end