mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
fix nuke_buckets for non-region tests
Signed-off-by: Joe Buck <jbbuck@gmail.com>
This commit is contained in:
parent
2a216abcb4
commit
ad9f3615e3
1 changed files with 20 additions and 16 deletions
|
@ -77,23 +77,27 @@ def nuke_prefixed_buckets_on_conn(prefix, name, conn):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def nuke_prefixed_buckets(prefix):
|
def nuke_prefixed_buckets(prefix):
|
||||||
# First, delete all buckets on the master connection
|
# If no regions are specified, use the simple method
|
||||||
for name, conn in s3.items():
|
if targets.main.master == None:
|
||||||
#if conn == s3[targets.main.master]:
|
for name, conn in s3.items():
|
||||||
if conn == targets.main.master.connection:
|
print 'Deleting buckets on {name}'.format(name=name)
|
||||||
print 'Deleting buckets on {name} (master)'.format(name=name)
|
|
||||||
nuke_prefixed_buckets_on_conn(prefix, name, conn)
|
|
||||||
|
|
||||||
# Then sync to propagate deletes to secondaries
|
|
||||||
region_sync_meta(targets.main, targets.main.master.connection)
|
|
||||||
print 'region-sync in nuke_prefixed_buckets'
|
|
||||||
|
|
||||||
# Now delete remaining buckets on any other connection
|
|
||||||
for name, conn in s3.items():
|
|
||||||
#if conn != s3[targets.main.master]:
|
|
||||||
if conn != targets.main.master.connection:
|
|
||||||
print 'Deleting buckets on {name} (non-master)'.format(name=name)
|
|
||||||
nuke_prefixed_buckets_on_conn(prefix, name, conn)
|
nuke_prefixed_buckets_on_conn(prefix, name, conn)
|
||||||
|
else:
|
||||||
|
# First, delete all buckets on the master connection
|
||||||
|
for name, conn in s3.items():
|
||||||
|
if conn == targets.main.master.connection:
|
||||||
|
print 'Deleting buckets on {name} (master)'.format(name=name)
|
||||||
|
nuke_prefixed_buckets_on_conn(prefix, name, conn)
|
||||||
|
|
||||||
|
# Then sync to propagate deletes to secondaries
|
||||||
|
region_sync_meta(targets.main, targets.main.master.connection)
|
||||||
|
print 'region-sync in nuke_prefixed_buckets'
|
||||||
|
|
||||||
|
# Now delete remaining buckets on any other connection
|
||||||
|
for name, conn in s3.items():
|
||||||
|
if conn != targets.main.master.connection:
|
||||||
|
print 'Deleting buckets on {name} (non-master)'.format(name=name)
|
||||||
|
nuke_prefixed_buckets_on_conn(prefix, name, conn)
|
||||||
|
|
||||||
print 'Done with cleanup of test buckets.'
|
print 'Done with cleanup of test buckets.'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue