s3 integration tests (#28396)

* Replace pause in integration tests with until.

Use resource prefix instead of generating a random number

Only try to delete keys if they exist

* Add alias to tests
This commit is contained in:
Sloane Hertel 2017-09-15 05:08:09 -04:00 committed by ansibot
commit bdbe5337c6
4 changed files with 21 additions and 26 deletions

View file

@ -353,7 +353,8 @@ def delete_bucket(module, s3, bucket):
# if there are contents then we need to delete them before we can delete the bucket
for keys in paginated_list(s3, Bucket=bucket):
formatted_keys = [{'Key': key} for key in keys]
s3.delete_objects(Bucket=bucket, Delete={'Objects': formatted_keys})
if formatted_keys:
s3.delete_objects(Bucket=bucket, Delete={'Objects': formatted_keys})
s3.delete_bucket(Bucket=bucket)
return True
except botocore.exceptions.ClientError as e: