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

Check that current directory isn't getting removed in calls to shtutils.rmtree... #2412

Closed
ekluzek opened this issue Mar 8, 2024 · 1 comment · Fixed by #2416
Closed
Assignees
Labels
enhancement new capability or improved behavior of existing capability

Comments

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 8, 2024

With run_neon there is a directory tree removal that should add some error checking to it. It should make sure the directory being used isn't the current one.

ctsm/site_and_regional/neon_site.py:            shutil.rmtree(case_path)
ctsm/site_and_regional/neon_site.py:                shutil.rmtree(case_root)

#2363 has this as well, but the code was just moved to a new location, so doesn't introduce it.

@ekluzek ekluzek added the enhancement new capability or improved behavior of existing capability label Mar 8, 2024
@ekluzek
Copy link
Collaborator Author

ekluzek commented Mar 8, 2024

This also relates to #2405. There is a proposal there to add a small utility for this, that would be a good way to handle this.

But, I think we should get a check in place right away and refactor when the utility is added at a later date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new capability or improved behavior of existing capability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants