summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Brown <cb@opscode.com>2010-02-26 22:07:52 -0800
committerChristopher Brown <cb@opscode.com>2010-02-26 22:07:52 -0800
commit8abe22ad8ab8f16a49ffcce121a14672874b8988 (patch)
tree35249afaf0c0782f2f0f889cb66acf571a757881
parent727a097ee6bb3639daca1052d9fbd299c885a6b3 (diff)
downloadchef-8abe22ad8ab8f16a49ffcce121a14672874b8988.tar.gz
add debugging to 500 retry case
-rw-r--r--chef/lib/chef/rest.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/chef/lib/chef/rest.rb b/chef/lib/chef/rest.rb
index 50b3f10074..423cb43c7d 100644
--- a/chef/lib/chef/rest.rb
+++ b/chef/lib/chef/rest.rb
@@ -73,7 +73,7 @@ class Chef
catch(:done) do
retries = Chef::Config[:client_registration_retries] || 5
- retries.downto(0) do
+ 0.upto(retries) do |n|
begin
response = nc.save(true, true)
Chef::Log.debug("Registration response: #{response.inspect}")
@@ -86,6 +86,7 @@ class Chef
rescue IOError
raise Chef::Exceptions::CannotWritePrivateKey, "I cannot write your private key to #{destination}"
rescue Net::HTTPFatalError => e
+ Chef::Log.warn("Failed attempt #{n} of #{retries+1} on client creation")
raise unless e.response.code == "500"
end
end