From d9f3324b5e138ef76aa58970e5e96feb5a0de7f8 Mon Sep 17 00:00:00 2001 From: Kyle Marsh Date: Tue, 12 Jul 2011 16:44:19 -0700 Subject: [PATCH] dho-qa: Verify multiple buckets Updates client verification tool to accept multiple bucket names on the command line and dump information for each in case we need to test different buckets. --- verify_client.py | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/verify_client.py b/verify_client.py index a21479d..7516562 100755 --- a/verify_client.py +++ b/verify_client.py @@ -54,27 +54,28 @@ def main(): else: OUTFILE = sys.stdout - try: - bucket = conn.get_bucket(args[0]) - except S3ResponseError as e: - print >> sys.stderr, "S3 claims %s isn't a valid bucket...maybe the user you specified in config.yml doesn't have access to it?" %args[0] - common.teardown() - return + for bucket_name in args: + try: + bucket = conn.get_bucket(bucket_name) + except S3ResponseError as e: + print >> sys.stderr, "S3 claims %s isn't a valid bucket...maybe the user you specified in config.yml doesn't have access to it?" %bucket_name + common.teardown() + return - (name, grants) = get_bucket_properties(bucket) - print >> OUTFILE, "Bucket Name: %s" % name - for grant in grants: - print >> OUTFILE, "\tgrant %s %s" %(grant) - - for key in bucket.list(): - full_key = bucket.get_key(key.name) - (name, size, grants, metadata) = get_key_properties(full_key) - print >> OUTFILE, name - print >> OUTFILE, "\tsize: %s" %size + (name, grants) = get_bucket_properties(bucket) + print >> OUTFILE, "Bucket Name: %s" % name for grant in grants: print >> OUTFILE, "\tgrant %s %s" %(grant) - for metadata_key in metadata: - print >> OUTFILE, "\tmetadata %s: %s" %(metadata_key, metadata[metadata_key]) + + for key in bucket.list(): + full_key = bucket.get_key(key.name) + (name, size, grants, metadata) = get_key_properties(full_key) + print >> OUTFILE, name + print >> OUTFILE, "\tsize: %s" %size + for grant in grants: + print >> OUTFILE, "\tgrant %s %s" %(grant) + for metadata_key in metadata: + print >> OUTFILE, "\tmetadata %s: %s" %(metadata_key, metadata[metadata_key])