fix nuke_buckets for non-region tests

Signed-off-by: Joe Buck <jbbuck@gmail.com>
This commit is contained in:
Joe Buck 2013-08-30 23:38:04 -07:00
parent 2a216abcb4
commit ad9f3615e3

View file

@ -77,9 +77,14 @@ def nuke_prefixed_buckets_on_conn(prefix, name, conn):
pass pass
def nuke_prefixed_buckets(prefix): def nuke_prefixed_buckets(prefix):
# If no regions are specified, use the simple method
if targets.main.master == None:
for name, conn in s3.items():
print 'Deleting buckets on {name}'.format(name=name)
nuke_prefixed_buckets_on_conn(prefix, name, conn)
else:
# First, delete all buckets on the master connection # First, delete all buckets on the master connection
for name, conn in s3.items(): for name, conn in s3.items():
#if conn == s3[targets.main.master]:
if conn == targets.main.master.connection: if conn == targets.main.master.connection:
print 'Deleting buckets on {name} (master)'.format(name=name) print 'Deleting buckets on {name} (master)'.format(name=name)
nuke_prefixed_buckets_on_conn(prefix, name, conn) nuke_prefixed_buckets_on_conn(prefix, name, conn)
@ -90,7 +95,6 @@ def nuke_prefixed_buckets(prefix):
# Now delete remaining buckets on any other connection # Now delete remaining buckets on any other connection
for name, conn in s3.items(): for name, conn in s3.items():
#if conn != s3[targets.main.master]:
if conn != targets.main.master.connection: if conn != targets.main.master.connection:
print 'Deleting buckets on {name} (non-master)'.format(name=name) 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)