mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-28 19:31:39 +00:00
Work-around for RGW failing to send IsTruncated on listing all keys.
Without this, it fails to delete the bucket when there's more than 1000 keys.
This commit is contained in:
parent
b6e0287810
commit
4959c5e1a4
1 changed files with 13 additions and 7 deletions
|
@ -50,6 +50,11 @@ def nuke_prefixed_buckets():
|
||||||
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')
|
||||||
|
# TODO: deleted_cnt and the while loop is a work around for rgw
|
||||||
|
# not sending the
|
||||||
|
deleted_cnt = 1
|
||||||
|
while deleted_cnt:
|
||||||
|
deleted_cnt = 0
|
||||||
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,
|
||||||
|
@ -57,6 +62,7 @@ def nuke_prefixed_buckets():
|
||||||
)
|
)
|
||||||
key.set_canned_acl('private')
|
key.set_canned_acl('private')
|
||||||
key.delete()
|
key.delete()
|
||||||
|
deleted_cnt += 1
|
||||||
bucket.delete()
|
bucket.delete()
|
||||||
except boto.exception.S3ResponseError as e:
|
except boto.exception.S3ResponseError as e:
|
||||||
# TODO workaround for buggy rgw that fails to send
|
# TODO workaround for buggy rgw that fails to send
|
||||||
|
|
Loading…
Reference in a new issue