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

Google: Only verify bucket if auto_create is True #575

Closed
wants to merge 1 commit into from

Conversation

jschneier
Copy link
Owner

No description provided.

@sww314 sww314 added the google label May 10, 2019
@@ -131,17 +130,15 @@ def _get_or_create_bucket(self, name):
"""
Retrieves a bucket if it exists, otherwise creates it.
"""
if not self.auto_create_bucket:
return Bucket(client=self.client, name=name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative syntax:

Suggested change
return Bucket(client=self.client, name=name)
return self.client.bucket(name)

@stanislavb
Copy link
Contributor

I was going to suggest such a change to get rid of storage.buckets.get permission requirement, but found that here it is! It also supersedes #412

jschneier pushed a commit that referenced this pull request Sep 8, 2019
Motivation for this change is to send fewer requests to Google Storage
API. We do not check existence of bucket unless auto_create_bucket is
configured or exists('') is called.

When creating bucket, instead of making two requests to get and create,
we just create and look for conflict.

Based on the work in #575 and supersedes #412.
@jschneier
Copy link
Owner Author

Merged #718 which takes this further.

@jschneier jschneier closed this Sep 8, 2019
@jschneier jschneier deleted the bucket-verify-autocreate branch September 8, 2019 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants