mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
Handle empty bucket while nuking
Signed-off-by: Andrew Gaul <andrew@gaul.org>
This commit is contained in:
parent
e4dafa0cc2
commit
31efb46b28
1 changed files with 4 additions and 1 deletions
|
@ -70,7 +70,10 @@ def nuke_prefixed_buckets_on_conn(prefix, name, conn):
|
|||
try:
|
||||
iterator = iter(bucket.list_versions())
|
||||
# peek into iterator to issue list operation
|
||||
try:
|
||||
keys = itertools.chain([next(iterator)], iterator)
|
||||
except StopIteration:
|
||||
keys = [] # empty iterator
|
||||
except boto.exception.S3ResponseError as e:
|
||||
# some S3 implementations do not support object
|
||||
# versioning - fall back to listing without versions
|
||||
|
|
Loading…
Reference in a new issue