Skip to content

Commit

Permalink
Merge pull request #187 from aboyett/fix-s3-us-east-1
Browse files Browse the repository at this point in the history
fix(create_bucket): avoid S3 InvalidLocationConstraint error
  • Loading branch information
Matthew Fisher authored Feb 23, 2017
2 parents 84fce10 + 5188f77 commit 93995d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rootfs/bin/create_bucket
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ if os.getenv('DATABASE_STORAGE') == "s3":
conn = boto.s3.connect_to_region(region)
if not bucket_exists(conn, bucket_name):
try:
conn.create_bucket(bucket_name, location=region)
if region == "us-east-1":
# use "US Standard" region. workaround for https://github.com/boto/boto3/issues/125
conn.create_bucket(bucket_name)
else:
conn.create_bucket(bucket_name, location=region)
# NOTE(bacongobbler): for versions prior to v2.9.0, the bucket is created in the default region.
# if we got here, we need to propagate "us-east-1" into WALE_S3_ENDPOINT because the bucket
# exists in a different region and we cannot find it.
Expand Down

0 comments on commit 93995d9

Please sign in to comment.