github.com/inflatablewoman/deis@v1.0.1-0.20141111034523-a4511c46a6ce/registry/templates/create_bucket (about)

     1  #!/usr/bin/env python
     2  import boto
     3  import sys
     4  from boto.s3.connection import OrdinaryCallingFormat
     5  
     6  conn = boto.connect_s3(aws_access_key_id='{{ .deis_store_gateway_accessKey }}',
     7                         aws_secret_access_key='{{ .deis_store_gateway_secretKey }}',
     8                         host='{{ .deis_store_gateway_host }}',
     9                         port={{ .deis_store_gateway_port }},
    10                         is_secure=False,
    11                         calling_format=OrdinaryCallingFormat(),
    12                        )
    13  bucket = sys.argv[1]
    14  
    15  if not bucket in conn.get_all_buckets():
    16    conn.create_bucket(bucket)