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

Avoid deleting blob when it's renamed to itself #6347

Closed
wants to merge 1 commit into from

Conversation

tjcelaya
Copy link

An issue was encountered where the new name for a blob was expected to differ from the existing name and the object was being deleted as a result of the copy-then-delete strategy.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 30, 2018
@@ -926,6 +927,9 @@ def rename_blob(self, blob, new_name, client=None):
:rtype: :class:`Blob`
:returns: The newly-renamed blob.
"""
if blob.name == new_name:
return blob

This comment was marked as spam.

This comment was marked as spam.

@tseaver tseaver added the api: storage Issues related to the Cloud Storage API. label Oct 30, 2018
@tseaver
Copy link
Contributor

tseaver commented Nov 1, 2018

@tjcelaya Thanks for the patch! In order to get test coverage, and the different semantics requested by @frankyn, I have opened #6365, which supersedes this PR.

@tjcelaya
Copy link
Author

tjcelaya commented Nov 1, 2018

@tseaver Darn, I only just this morning found time to get nox installed and working correctly. Ah well, there's even additional testing improvements as well so I can't complain that you beat me to the fix. 😅

Regardless, thanks for jumping on it so quickly!

@frankyn
Copy link
Member

frankyn commented Nov 2, 2018

Let's close this PR out if it's no longer needed. Apologies if this is not the case.

@frankyn frankyn closed this Nov 2, 2018
tseaver added a commit that referenced this pull request Nov 5, 2018
@tjcelaya tjcelaya deleted the patch-1 branch November 7, 2018 20:06
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