Skip to content

Commit

Permalink
Respond to feedback from RD
Browse files Browse the repository at this point in the history
  • Loading branch information
datamel committed May 12, 2021
1 parent 71a3f1c commit 5caf6f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions cylc/flow/workflow_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def register(
Creates the .service directory.
Args:
flow_name: workflow name, default basename($PWD).
flow_name: workflow name.
source: directory location of flow.cylc file, default $PWD.
Return:
Expand All @@ -549,6 +549,8 @@ def register(
- Nested workflow run directories.
"""
validate_flow_name(flow_name)
import mdb
mdb.debug()
if source is not None:
if os.path.basename(source) == WorkflowFiles.FLOW_FILE:
source = os.path.dirname(source)
Expand Down Expand Up @@ -1143,7 +1145,9 @@ def install_workflow(
check_nested_run_dirs(rundir, flow_name)
symlinks_created = {}
named_run = flow_name
if run_num:
if run_name:
named_run = os.path.join(named_run, run_name)
elif run_num:
named_run = os.path.join(named_run, f'run{run_num}')
if not no_symlinks:
symlinks_created = make_localhost_symlinks(rundir, named_run)
Expand Down Expand Up @@ -1174,6 +1178,7 @@ def install_workflow(
if no_run_name:
cylc_install = Path(rundir, WorkflowFiles.Install.DIRNAME)
source_link = cylc_install.joinpath(WorkflowFiles.Install.SOURCE)
# check source link matches the source symlink from workflow dir.
cylc_install.mkdir(parents=True, exist_ok=True)
if not source_link.exists():
install_log.info(f"Creating symlink from {source_link}")
Expand All @@ -1184,7 +1189,6 @@ def install_workflow(
else:
raise WorkflowFilesError(
"Source directory between runs are not consistent.")
# check source link matches the source symlink from workflow dir.
install_log.info(f'INSTALLED {named_run} from {source}')
print(f'INSTALLED {named_run} from {source}')
_close_install_log(install_log)
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/cylc-install/02-failures.t
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ make_rnd_workflow
pushd "${RND_WORKFLOW_SOURCE}" || exit 1
run_ok "${TEST_NAME}" cylc install --run-name=olaf
contains_ok "${TEST_NAME}.stdout" <<__OUT__
INSTALLED ${RND_WORKFLOW_NAME} from ${RND_WORKFLOW_SOURCE}
INSTALLED ${RND_WORKFLOW_NAME}/olaf from ${RND_WORKFLOW_SOURCE}
__OUT__
TEST_NAME="${TEST_NAME_BASE}-install-twice-mix-options-1-2nd-install"
run_fail "${TEST_NAME}" cylc install
Expand Down Expand Up @@ -167,7 +167,7 @@ make_rnd_workflow
pushd "${RND_WORKFLOW_SOURCE}" || exit 1
run_ok "${TEST_NAME}" cylc install --run-name=olaf
contains_ok "${TEST_NAME}.stdout" <<__OUT__
INSTALLED ${RND_WORKFLOW_NAME} from ${RND_WORKFLOW_SOURCE}
INSTALLED ${RND_WORKFLOW_NAME}/olaf from ${RND_WORKFLOW_SOURCE}
__OUT__
TEST_NAME="${TEST_NAME_BASE}-install-twice-same-run-name-2nd-install"
run_fail "${TEST_NAME}" cylc install --run-name=olaf
Expand Down

0 comments on commit 5caf6f1

Please sign in to comment.