We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 81ebefa + 388c593 commit 6fb2999Copy full SHA for 6fb2999
rootfs/bin/create_bucket
@@ -2,7 +2,7 @@
2
3
import os
4
5
-import boto
+import boto.s3
6
import json
7
import swiftclient
8
from boto import config as botoconfig
@@ -19,12 +19,13 @@ def bucket_exists(conn, name):
19
return True
20
21
bucket_name = os.getenv('BUCKET_NAME')
22
+region = os.getenv('AWS_REGION')
23
24
if os.getenv('DATABASE_STORAGE') == "s3":
- conn = boto.connect_s3()
25
+ conn = boto.s3.connect_to_region(region)
26
27
if not bucket_exists(conn, bucket_name):
- conn.create_bucket(bucket_name)
28
+ conn.create_bucket(bucket_name, location=region)
29
30
elif os.getenv('DATABASE_STORAGE') == "gcs":
31
scopes = ['https://www.googleapis.com/auth/devstorage.full_control']
0 commit comments