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

Copy files when they originate out of MEDIA_ROOT #486

Merged
merged 1 commit into from Jan 10, 2020

Conversation

bmbouter
Copy link
Member

@bmbouter bmbouter commented Jan 8, 2020

Django would move files in cases where the source was a file:///
repository.

https://pulp.plan.io/issues/5941
closes #5941

https://pulp.plan.io/issues/5870
closes #5870

@bmbouter bmbouter force-pushed the switch-save-to-leave-files-in-tact branch 2 times, most recently from a6cd20a to a3f3c15 Compare January 8, 2020 23:05
@bmbouter bmbouter force-pushed the switch-save-to-leave-files-in-tact branch 4 times, most recently from b4dbddc to eb60095 Compare January 10, 2020 19:49
@bmbouter bmbouter changed the title Leave files in tact when saving them to Storage Copy files when they originate out of MEDIA_ROOT Jan 10, 2020
@bmbouter bmbouter force-pushed the switch-save-to-leave-files-in-tact branch from eb60095 to b20fd8d Compare January 10, 2020 20:18
_file.close()
else:
os.close(fd)
except FileExistsError:
Copy link
Member

Choose a reason for hiding this comment

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

Can you refactor this except so that it is more closely located to the code that emits the exception?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes! I pushed that just now.

Copy link
Member Author

Choose a reason for hiding this comment

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

That fails on the open due to the 0o666 open mode, so the exception handler being down here is needed.

@bmbouter bmbouter force-pushed the switch-save-to-leave-files-in-tact branch from b20fd8d to 78e8fda Compare January 10, 2020 20:37
Django would move files in cases where the source was a file:///
repository.

https://pulp.plan.io/issues/5941
closes #5941

https://pulp.plan.io/issues/5870
closes #5870
@bmbouter bmbouter force-pushed the switch-save-to-leave-files-in-tact branch from 78e8fda to 07340fd Compare January 10, 2020 20:55
Copy link
Contributor

@daviddavis daviddavis left a comment

Choose a reason for hiding this comment

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

Tested this out and confirmed it fixed the problem.

@bmbouter bmbouter merged commit c9da146 into pulp:master Jan 10, 2020
@bmbouter bmbouter deleted the switch-save-to-leave-files-in-tact branch January 10, 2020 21:27
@pulpbot pulpbot mentioned this pull request Jan 14, 2020
@pulpbot pulpbot mentioned this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants