s3tools/s3cmd — pull request #399 by davidjmemmett (2014-10-12 13:27:45+00:00)
Title: Added ability to retry tests

Test "57 Get current expiration setting" fails every now and then, likely due to the change not being propagated quick enough in S3. Thus, I have added the ability for tests to retry when they fail. The default retry limit I have proposed is 5, and I added an exception for the test in question, raising it to 10 attempts, just in case.

As I was testing this locally, and not on EC2, I added a check in S3/Config.py so that it only tries to look for IAM role credentials when running on EC2. You get this error if you run s3cmd without any environment variables set on a non-EC2 instance. I thought it'd be better than getting a Python error relating to a socket timeout when trying to fetch IAM role credentials.

I believe that there may be a bigger issue with IAM credentials overriding the values set in ~/.s3cfg, but I am yet to write up an issue for it.