mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-22 09:29:43 +00:00
teardown: clean object versions
also don't set acls on buckets, objects before removing, no need for that. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
parent
517abbb468
commit
d4e9e40792
1 changed files with 5 additions and 3 deletions
|
@ -59,17 +59,19 @@ def nuke_prefixed_buckets_on_conn(prefix, name, conn):
|
||||||
name=name,
|
name=name,
|
||||||
prefix=prefix,
|
prefix=prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
for bucket in conn.get_all_buckets():
|
for bucket in conn.get_all_buckets():
|
||||||
|
print 'prefix=',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')
|
# bucket.set_canned_acl('private')
|
||||||
for key in bucket.list():
|
for key in bucket.list_versions():
|
||||||
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.set_canned_acl('private')
|
||||||
key.delete()
|
key.delete()
|
||||||
bucket.delete()
|
bucket.delete()
|
||||||
except boto.exception.S3ResponseError as e:
|
except boto.exception.S3ResponseError as e:
|
||||||
|
|
Loading…
Reference in a new issue