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

Preserve ACL when copying or renaming blob. #2409

Merged
merged 3 commits into from Sep 28, 2016

Conversation

daspecster
Copy link
Contributor

See: #2389

ACL settings are not held when copying a blob or renaming a blob.

Adds preserve_acl to Bucket.copy_blob and Bucket.rename_blob.

@daspecster daspecster added the api: storage Issues related to the Cloud Storage API. label Sep 23, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 23, 2016
@@ -440,7 +440,7 @@ def delete_blobs(self, blobs, on_error=None, client=None):
raise

def copy_blob(self, blob, destination_bucket, new_name=None,
client=None):
client=None, preserve_acl=False):

This comment was marked as spam.

This comment was marked as spam.

return new_blob

def rename_blob(self, blob, new_name, client=None):
def rename_blob(self, blob, new_name, client=None, preserve_acl=False):

This comment was marked as spam.

This comment was marked as spam.

self.assertIs(new_blob.bucket, dest)
self.assertEqual(new_blob.name, NEW_NAME)
self.assertIsInstance(new_blob.acl, ObjectACL)
self.assertFalse(new_blob.acl.loaded)
self.assertEqual(new_blob.acl.entities, {})

This comment was marked as spam.

@daspecster
Copy link
Contributor Author

I finally circled back around.
@tseaver I think I found the issue! I had the wrong order of operations.
I also added assertions for the expected requests.

Copy link
Contributor

@tseaver tseaver left a comment

Choose a reason for hiding this comment

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

LGTM

@daspecster daspecster merged commit a7cb215 into googleapis:master Sep 28, 2016
@daspecster daspecster deleted the add-storage-preserve-acl branch September 28, 2016 09:23
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.

None yet

4 participants