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

Using a fallback connection in Bucket #759

Closed
wants to merge 3 commits into from

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Mar 25, 2015

This is an alternative fix to #728, by way of making connection be optional.

This has an effect of cascading through everything since ACL and Blob both use the connection of the Bucket.

Note especially the changes to get_bucket and create_bucket, which passes None through to the Bucket() constructor and lets the environment dictate the connection (e.g. in a batch).


@tseaver Do you think bucket.connection being a non-deterministic value will be confounding?

@dhermes dhermes added the api: storage Issues related to the Cloud Storage API. label Mar 25, 2015
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 25, 2015
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 69c321f on dhermes:bucket-connection-fallback into d34a15e on GoogleCloudPlatform:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 69c321f on dhermes:bucket-connection-fallback into d34a15e on GoogleCloudPlatform:master.

@@ -143,6 +135,9 @@ def create_bucket(bucket_name, project=None, connection=None):

This implements "storage.buckets.insert".

If the bucket already exists, will raise
:class:`gcloud.exceptions.Conflict`.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling adc470b on dhermes:bucket-connection-fallback into 4d69bb3 on GoogleCloudPlatform:master.

@dhermes
Copy link
Contributor Author

dhermes commented Mar 28, 2015

@tseaver I rebased this after merging #760 but as mentioned, it may make more sense to just pass connection to methods that require it, as in #728 (or use the implicit fallback).

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling adc470b on dhermes:bucket-connection-fallback into 4d69bb3 on GoogleCloudPlatform:master.

@dhermes
Copy link
Contributor Author

dhermes commented Mar 30, 2015

After discussing with @tseaver it has been determined that unbundling Connection and Bucket is possible, so I am closing this out. Will salvage some parts of it, like Bucket.create() and send out another PR.

@dhermes dhermes closed this Mar 30, 2015
@dhermes dhermes deleted the bucket-connection-fallback branch March 30, 2015 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants