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
Preserve ACL when copying or renaming blob. #2409
Conversation
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
This comment was marked as spam.
Sorry, something went wrong.
8e85462
to
04ea4f7
Compare
I finally circled back around. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
See: #2389
ACL settings are not held when copying a blob or renaming a blob.
Adds
preserve_acl
toBucket.copy_blob
andBucket.rename_blob
.