mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-28 19:31:39 +00:00
Merge pull request #52 from andrewgaul/nuke-empty-bucket
Handle empty bucket while nuking Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
commit
f9ab26c05c
1 changed files with 4 additions and 1 deletions
|
@ -70,7 +70,10 @@ def nuke_prefixed_buckets_on_conn(prefix, name, conn):
|
||||||
try:
|
try:
|
||||||
iterator = iter(bucket.list_versions())
|
iterator = iter(bucket.list_versions())
|
||||||
# peek into iterator to issue list operation
|
# peek into iterator to issue list operation
|
||||||
keys = itertools.chain([next(iterator)], iterator)
|
try:
|
||||||
|
keys = itertools.chain([next(iterator)], iterator)
|
||||||
|
except StopIteration:
|
||||||
|
keys = [] # empty iterator
|
||||||
except boto.exception.S3ResponseError as e:
|
except boto.exception.S3ResponseError as e:
|
||||||
# some S3 implementations do not support object
|
# some S3 implementations do not support object
|
||||||
# versioning - fall back to listing without versions
|
# versioning - fall back to listing without versions
|
||||||
|
|
Loading…
Reference in a new issue