Skip to content

Commit

Permalink
Merge pull request #75 from kmala/store
Browse files Browse the repository at this point in the history
fix(boto): specify the region while getting s3 connection
  • Loading branch information
kmala authored Nov 29, 2016
2 parents 6873f66 + 6e27041 commit fe50d7a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rootfs/bin/create-bucket
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

import boto
import boto.s3
import json
import swiftclient
from boto import config as botoconfig
Expand All @@ -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('REGISTRY_STORAGE') == "s3" and os.getenv('REGISTRY_STORAGE_S3_BACKEND') != 'minio':
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('REGISTRY_STORAGE') == "gcs":
scopes = ['https://www.googleapis.com/auth/devstorage.full_control']
Expand Down

0 comments on commit fe50d7a

Please sign in to comment.