Skip to content

Commit

Permalink
aws: fix bucket creation in us-east-1
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Apr 12, 2024
1 parent 64fc88b commit d1ccd3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kvirt/providers/aws/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1659,8 +1659,9 @@ def create_bucket(self, bucket, public=False):
if bucket in self.list_buckets():
error(f"Bucket {bucket} already there")
return
location = {'LocationConstraint': self.region}
args = {'Bucket': bucket, "CreateBucketConfiguration": location}
args = {'Bucket': bucket}
if self.region != 'us-east-1':
args["CreateBucketConfiguration"] = {'LocationConstraint': self.region}
args['ObjectOwnership'] = 'ObjectWriter'
s3.create_bucket(**args)
s3.put_public_access_block(Bucket=bucket, PublicAccessBlockConfiguration={
Expand Down

0 comments on commit d1ccd3e

Please sign in to comment.