diff --git a/rootfs/bin/create_bucket b/rootfs/bin/create_bucket index c190dd8..139f77a 100755 --- a/rootfs/bin/create_bucket +++ b/rootfs/bin/create_bucket @@ -2,7 +2,7 @@ import os -import boto +import boto.s3 import json import swiftclient from boto import config as botoconfig @@ -19,12 +19,13 @@ def bucket_exists(conn, name): return True bucket_name = os.getenv('BUCKET_NAME') +region = os.getenv('AWS_REGION') if os.getenv('DATABASE_STORAGE') == "s3": - conn = boto.connect_s3() + conn = boto.s3.connect_to_region(region) if not bucket_exists(conn, bucket_name): - conn.create_bucket(bucket_name) + conn.create_bucket(bucket_name, location=region) elif os.getenv('DATABASE_STORAGE') == "gcs": scopes = ['https://www.googleapis.com/auth/devstorage.full_control']