Skip to content

Commit

Permalink
review amends
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Dawson committed Nov 15, 2023
1 parent abf7078 commit a800925
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion cylc/flow/scheduler_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,11 @@ async def scheduler_cli(
)

# run the workflow
# ret = asyncio.new_event_loop().run_until_complete(_run(scheduler))
if options.no_detach:
ret = await _run(scheduler)
else:
# Note: The daemonization messes with asyncio so we have to start a
# new event loop if detaching
ret = asyncio.run(
_run(scheduler)
)
Expand Down
3 changes: 1 addition & 2 deletions cylc/flow/scripts/reinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ def main(
opts: 'Values',
*ids: str
) -> None:
# """CLI wrapper."""
# reinstall_cli(opts, args)
"""CLI wrapper."""
call_multi(
partial(reinstall_cli, opts),
*ids,
Expand Down
4 changes: 2 additions & 2 deletions cylc/flow/scripts/validate_reinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ def check_tvars_and_workflow_stopped(

@cli_function(get_option_parser)
def main(parser: COP, options: 'Values', workflow_id: str):
sys.exit(asyncio.run(vro_cli(parser, options, workflow_id)))
sys.exit(asyncio.run(vr_cli(parser, options, workflow_id)))


async def vro_cli(parser: COP, options: 'Values', workflow_id: str):
async def vr_cli(parser: COP, options: 'Values', workflow_id: str):
"""Run Cylc (re)validate - reinstall - reload in sequence."""
# Attempt to work out whether the workflow is running.
# We are trying to avoid reinstalling then subsequently being
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/test_reinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from pathlib import Path
from types import SimpleNamespace
from uuid import uuid1
from functools import partial

import pytest

Expand All @@ -37,7 +38,7 @@
from cylc.flow.workflow_files import (
WorkflowFiles,
)

from cylc.flow.network.multi import call_multi

ReInstallOptions = Options(reinstall_gop())

Expand Down Expand Up @@ -89,8 +90,6 @@ def one_run(one_src, test_dir, run_dir):
id=str(w_run_dir.relative_to(run_dir)),
)

from functools import partial
from cylc.flow.network.multi import call_multi

async def test_rejects_random_workflows(one, one_run):
"""It should only work with workflows installed by cylc install."""
Expand Down

0 comments on commit a800925

Please sign in to comment.