diff options
author | Christopher Brown <cb@opscode.com> | 2010-02-26 22:07:52 -0800 |
---|---|---|
committer | Christopher Brown <cb@opscode.com> | 2010-02-26 22:07:52 -0800 |
commit | 8abe22ad8ab8f16a49ffcce121a14672874b8988 (patch) | |
tree | 35249afaf0c0782f2f0f889cb66acf571a757881 | |
parent | 727a097ee6bb3639daca1052d9fbd299c885a6b3 (diff) | |
download | chef-8abe22ad8ab8f16a49ffcce121a14672874b8988.tar.gz |
add debugging to 500 retry case
-rw-r--r-- | chef/lib/chef/rest.rb | 3 |
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 |