Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s3 backend us-east-1 boto3 workaround #294

Closed
ninglesby opened this issue Nov 15, 2020 · 3 comments
Closed

s3 backend us-east-1 boto3 workaround #294

ninglesby opened this issue Nov 15, 2020 · 3 comments
Labels

Comments

@ninglesby
Copy link
Contributor

Hey I just started playing around with zou, and it is great! I found a little bug that is pretty easy to fix. I have never done a PR before, is this something I should do or is it small enough that it would be easier for someone else to take care of?

I was getting a LocationConstraint Error when trying to use s3. I found this Boto3 Issue , which seems to indicate that "us-east-1" is a special case and should not be used with LocationConstraint.

file_store.py

    try:
        self.bucket.create(
            CreateBucketConfiguration={
                'LocationConstraint': config.region
            }
        )
    except self.s3.meta.client.exceptions.BucketAlreadyOwnedByYou:
        pass

I changed it to

    try:
        if config.region == "us-east-1":
            self.bucket.create()
        else:
            self.bucket.create(
                CreateBucketConfiguration={
                    'LocationConstraint': config.region
                }
            )
    except self.s3.meta.client.exceptions.BucketAlreadyOwnedByYou:
        pass

And that seemed to do the trick.

@frankrousseau
Copy link
Contributor

Hello @ninglesby,

Thank you for the information. And yes the best is that you make a PR to fix this problem.

@frankrousseau
Copy link
Contributor

I made the fix. Can you confirm that it works?

@ninglesby
Copy link
Contributor Author

It works, Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants