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

Support symlinked alternate run directories (cylc 7). #3203

Merged
merged 8 commits into from
Aug 30, 2019
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
Prev Previous commit
Next Next commit
Handle existing alt run dirs.
  • Loading branch information
hjoliver committed Aug 29, 2019
commit 84006f033d5f8672bdbe93cbeb0a32e4027590e8
15 changes: 14 additions & 1 deletion lib/cylc/suite_srv_files_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,21 @@ def register(self, reg=None, source=None, redirect=False, rundir=None):
alt_srv_d = os.path.join(rundir, reg, srv_d_name)
os.makedirs(alt_srv_d, exist_ok=True)
os.makedirs(os.path.dirname(suite_run_d), exist_ok=True)
os.symlink(alt_suite_run_d, suite_run_d)
if os.path.islink(suite_run_d) and not os.path.exists(suite_run_d):
# Remove a bad symlink.
os.unlink(suite_run_d)
if not os.path.exists(suite_run_d):
os.symlink(alt_suite_run_d, suite_run_d)
elif not os.path.islink(suite_run_d):
raise SuiteServiceFileError(
f"Run directory '{suite_run_d}' already exists.")
elif alt_suite_run_d != os.readlink(suite_run_d):
target = os.readlink(suite_run_d)
raise SuiteServiceFileError(
f"Symlink '{suite_run_d}' already points to {target}.")
# (else already the right symlink)

temp = None
# See if suite already has a source or not
try:
orig_source = os.readlink(
Expand Down