#!/usr/bin/env python
import boto
import sys
from boto.s3.connection import OrdinaryCallingFormat

conn = boto.connect_s3(host='{{ getv "/deis/store/gateway/host" }}',
                       port={{ getv "/deis/store/gateway/port" }},
                       is_secure=False,
                       calling_format=OrdinaryCallingFormat(),
                      )
bucket = sys.argv[1]

if not bucket in conn.get_all_buckets():
  conn.create_bucket(bucket)
