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

Fixed WorkerDirectory.delete() causing infinite recursion when permission errors occur #780

Merged
merged 1 commit into from Jul 9, 2020

Conversation

gerrod3
Copy link
Contributor

@gerrod3 gerrod3 commented Jul 9, 2020

WorkerDirectory.delete() now only tries one additional time to delete its directory tree after encountering a PermissionError

fixes #6504
https://pulp.plan.io/issues/6504

@pulpbot
Copy link
Member

pulpbot commented Jul 9, 2020

Attached issue: https://pulp.plan.io/issues/6504

Copy link
Contributor

@dralley dralley left a comment

Choose a reason for hiding this comment

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

Awesome!

shutil.rmtree(self.path)
except FileNotFoundError:
pass
except PermissionError:
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't strictly necessary since it's just being raised afterwards -- it doesn't hurt anything though.

If you do decide to remove it, could you also move this method below the delete() method? Both of these are no big deal though.

…sion errors occur

WorkerDirectory.delete() now only trys one additional time to delete its directory tree after encountering a PermissionError

fixes #6504
https://pulp.plan.io/issues/6504
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

3 participants