mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user