summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-07-03 16:36:44 -0700
committerClaire McQuin <claire@getchef.com>2014-07-10 09:47:17 -0700
commitb87daa926ebf9645ad88367803551fc679ba6522 (patch)
tree1d4e1f9e4d541516c0e71cc42f5bff52961146eb
parent924e96b04ea6200e0809e59794c7805e292bfcec (diff)
downloadchef-b87daa926ebf9645ad88367803551fc679ba6522.tar.gz
Set Net::HTTP open_timeout
-rw-r--r--CHANGELOG.md1
-rw-r--r--chef/lib/chef/rest/rest_request.rb1
-rw-r--r--chef/spec/unit/rest/auth_credentials_spec.rb5
3 files changed, 7 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5aafbafc68..a86ebf1ba4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
* `options` attribute of mount resource now supports lazy evaluation. (CHEF-5163)
* Fix OS X service provider actions that don't require the service label
to work when there is no plist. (backport CHEF-5223)
+* Set Net::HTTP open_timeout. (backport Chef-1585)
## 10.32.2
diff --git a/chef/lib/chef/rest/rest_request.rb b/chef/lib/chef/rest/rest_request.rb
index 3dfc576b3e..fe4ee4cf76 100644
--- a/chef/lib/chef/rest/rest_request.rb
+++ b/chef/lib/chef/rest/rest_request.rb
@@ -200,6 +200,7 @@ class Chef
end
@http_client.read_timeout = config[:rest_timeout]
+ @http_client.open_timeout = config[:rest_timeout]
end
diff --git a/chef/spec/unit/rest/auth_credentials_spec.rb b/chef/spec/unit/rest/auth_credentials_spec.rb
index a2034f96ed..a609997f2f 100644
--- a/chef/spec/unit/rest/auth_credentials_spec.rb
+++ b/chef/spec/unit/rest/auth_credentials_spec.rb
@@ -211,6 +211,11 @@ describe Chef::REST::RESTRequest do
new_request.http_client.read_timeout.should == 9001
end
+ it "configures the HTTP client with the open timeout set in the config file" do
+ Chef::Config[:rest_timeout] = 9001
+ new_request.http_client.read_timeout.should == 9001
+ end
+
describe "for SSL" do
before do
Chef::Config[:ssl_client_cert] = nil