3 # Delete all files on S3 used for a benchmarking run (we don't want to be
4 # charged for storage of them).
6 import boto, sys, time, Queue
7 from boto.s3.connection import SubdomainCallingFormat
8 from threading import Lock, Thread
11 bucket_name = sys.argv[1]
13 bucket_name = 'mvrable-bluesky'
16 print "Will delete all contents of %s starting in %s seconds..." \
17 % (bucket_name, DELAY)
21 print "Using %d threads" % (THREADS,)
23 q = Queue.Queue(THREADS * 4096)
27 conn = boto.connect_s3()
28 bucket = conn.get_bucket(bucket_name)
37 for i in range(THREADS):
38 t = Thread(target=deletion_task)
42 conn = boto.connect_s3(is_secure=False,
43 calling_format=SubdomainCallingFormat())
44 bucket = conn.get_bucket(bucket_name)