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 symlink target. #4890

Merged
merged 6 commits into from
Jul 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Check symlink target.
  • Loading branch information
hjoliver committed May 20, 2022
commit 7c825c614fca2061b3ba07d3e8058a1e3b8d5b5c
6 changes: 5 additions & 1 deletion cylc/flow/pathutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,11 @@ def make_symlink(path: Union[Path, str], target: Union[Path, str]) -> bool:
except OSError:
raise WorkflowFilesError(
f"Error when symlinking. Failed to unlink bad symlink {path}.")
target.mkdir(parents=True, exist_ok=True)
try:
target.mkdir(parents=True, exist_ok=False)
except FileExistsError:
raise WorkflowFilesError(f"Symlink target already exists: {target}.")


# This is needed in case share and share/cycle have the same symlink dir:
if path.exists():
Expand Down