mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07: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:
parent
e0a5b7d7ea
commit
bdbe5337c6
4 changed files with 21 additions and 26 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue