diff options
author | Tim Hinderliter <tim@opscode.com> | 2010-11-05 16:23:28 -0700 |
---|---|---|
committer | Tim Hinderliter <tim@opscode.com> | 2010-11-05 17:07:09 -0700 |
commit | b2d6008a0b7ece0ef4ef4d142ace135b2492e56e (patch) | |
tree | d5882fbaec606a80c78c41cf2214b04b60d47c57 | |
parent | 2dc5496f59856b04f562e36d6ec187328cfd5eba (diff) | |
download | chef-b2d6008a0b7ece0ef4ef4d142ace135b2492e56e.tar.gz |
in features tests couchdb replicate, changed log level from 'error' to 'debug' when POST to create target db fails (which happens due to a couch bug, and then we try again); output a new message @ 'error' if we reach the maximum number of tries
-rw-r--r-- | features/support/couchdb_replicate.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/features/support/couchdb_replicate.rb b/features/support/couchdb_replicate.rb index 79ddfc1277..c44970e0bd 100644 --- a/features/support/couchdb_replicate.rb +++ b/features/support/couchdb_replicate.rb @@ -96,9 +96,11 @@ def replicate_dbs(replication_specs, delete_source_dbs = false) RestClient.put(target_db, nil) db_created = true rescue RestClient::PreconditionFailed => e - Chef::Log.error("In creating #{target_db} try #{num_tries}/#{max_tries}, got #{e}; try again") if num_tries <= max_tries + Chef::Log.debug("In creating #{target_db} try #{num_tries}/#{max_tries}, got #{e}; try again") sleep 0.25 + else + Chef::Log.error("In creating #{target_db}, tried #{max_tries} times: got #{e}; giving up") end end num_tries += 1 |