test_s3 should reset permissions prior to attempting delete

This commit is contained in:
Wesley Spikes 2011-07-06 16:03:47 -07:00
parent 82693cea22
commit 3ee10d3dbe

View file

@ -62,11 +62,13 @@ def nuke_prefixed_buckets(prefix):
if bucket.name.startswith(prefix): if bucket.name.startswith(prefix):
print 'Cleaning bucket {bucket}'.format(bucket=bucket) print 'Cleaning bucket {bucket}'.format(bucket=bucket)
try: try:
bucket.set_canned_acl('private')
for key in bucket.list(): for key in bucket.list():
print 'Cleaning bucket {bucket} key {key}'.format( print 'Cleaning bucket {bucket} key {key}'.format(
bucket=bucket, bucket=bucket,
key=key, key=key,
) )
key.set_canned_acl('private')
key.delete() key.delete()
bucket.delete() bucket.delete()
except boto.exception.S3ResponseError as e: except boto.exception.S3ResponseError as e: