Skip to content

Commit

Permalink
workaround for boto/boto3#125
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c committed Jul 16, 2021
1 parent f194cbf commit 1b70c30
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/toil/jobStores/aws/jobStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,20 @@ def bucket_creation_pending(error):
logger.debug("Bucket '%s' does not exist.", bucket_name)
if create:
logger.debug("Creating bucket '%s'.", bucket_name)
location = region_to_bucket_location(self.region)
bucket = self.s3_resource.create_bucket(
Bucket=bucket_name,
CreateBucketConfiguration={'LocationConstraint': location})
location = self.region
if (
location == "us-east-1"
): # see https://github.com/boto/boto3/issues/125
bucket = self.s3_resource.create_bucket(
Bucket=bucket_name
)
else:
bucket = self.s3_resource.create_bucket(
Bucket=bucket_name,
CreateBucketConfiguration={
"LocationConstraint": location
},
)
# Wait until the bucket exists before checking the region and adding tags
bucket.wait_until_exists()

Expand Down

0 comments on commit 1b70c30

Please sign in to comment.