Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions s3tests/functional/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@ def nuke_bucket(client, bucket):
Delete={'Objects': objects, 'Quiet': True},
BypassGovernanceRetention=True)

# abort any ongoing multipart uploads before deleting the bucket
try:
uploads = client.list_multipart_uploads(Bucket=bucket)
for upload in uploads.get('Uploads', []):
client.abort_multipart_upload(
Bucket=bucket,
Key=upload['Key'],
UploadId=upload['UploadId']
)
except ClientError:
pass # bucket might not exist or have no uploads

client.delete_bucket(Bucket=bucket)

def nuke_prefixed_buckets(prefix, client=None):
Expand Down