Skip to content

Commit

Permalink
Get both workflow name and workflow id from install:
Browse files Browse the repository at this point in the history
Where name is `workflow` and id is `workflow/runX` or `workflow/name`.
  • Loading branch information
wxtim committed Jan 24, 2023
1 parent baf308e commit ae68884
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions cylc/flow/scripts/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ def install_cli(
reg: Optional[str] = None
) -> str:
"""Install workflow and scan for already-running instances."""
wf_name = install(opts, reg)
wf_name, wf_id = install(opts, reg)
asyncio.run(
scan(wf_name, not opts.no_ping)
)
return wf_name
return wf_name, wf_id


def install(
Expand Down Expand Up @@ -306,7 +306,7 @@ def install(
elif opts.symlink_dirs:
cli_symdirs = parse_cli_sym_dirs(opts.symlink_dirs)

source_dir, rundir, workflow_name = install_workflow(
source_dir, rundir, workflow_name, workflow_id = install_workflow(
source=source,
workflow_name=opts.workflow_name,
run_name=opts.run_name,
Expand All @@ -331,4 +331,5 @@ def install(
entry_point.name,
exc
) from None
return workflow_name

return workflow_name, workflow_id
2 changes: 1 addition & 1 deletion cylc/flow/scripts/validate_install_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def main(parser: COP, options: 'Values', workflow_id: Optional[str] = None):
validate_main(parser, options, str(source))

log_subcommand('install', source)
workflow_id = cylc_install(options, workflow_id)
_, workflow_id = cylc_install(options, workflow_id)

cleanup_sysargv(
'play',
Expand Down
2 changes: 1 addition & 1 deletion cylc/flow/workflow_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ def install_workflow(
install_log.info(f'INSTALLED {named_run} from {source}')
print(f'INSTALLED {named_run} from {source}')
close_log(install_log)
return source, rundir, named_run
return source, rundir, workflow_name, named_run


def get_run_dir_info(
Expand Down

0 comments on commit ae68884

Please sign in to comment.