github.com/technosophos/deis@v1.7.1-0.20150915173815-f9005256004b/database/templates/create_bucket (about) 1 #!/usr/bin/env python 2 3 import boto 4 import sys 5 from boto.s3.connection import OrdinaryCallingFormat 6 7 8 conn = boto.connect_s3( 9 host='{{ getv "/deis/store/gateway/host" }}', 10 port={{ getv "/deis/store/gateway/port" }}, 11 is_secure=False, 12 calling_format=OrdinaryCallingFormat()) 13 name = sys.argv[1] 14 15 if name not in (bucket.name for bucket in conn.get_all_buckets()): 16 conn.create_bucket(name)