Skip to content

Commit 747e2af

Browse files
play: print the logo to the user's terminal only (#6170)
1 parent 22cd58b commit 747e2af

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

changes.d/fix.6170.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix an issue where the Cylc logo could appear in the workflow log.

cylc/flow/scheduler_cli.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,12 @@ async def scheduler_cli(
400400
# upgrade the workflow DB (after user has confirmed upgrade)
401401
_upgrade_database(db_file)
402402

403-
# re-execute on another host if required
404-
_distribute(options.host, workflow_id_raw, workflow_id, options.color)
405-
406403
# print the start message
407404
_print_startup_message(options)
408405

406+
# re-execute on another host if required
407+
_distribute(options.host, workflow_id_raw, workflow_id, options.color)
408+
409409
# setup the scheduler
410410
# NOTE: asyncio.run opens an event loop, runs your coro,
411411
# then shutdown async generators and closes the event loop
@@ -561,10 +561,14 @@ def _upgrade_database(db_file: Path) -> None:
561561

562562

563563
def _print_startup_message(options):
564-
"""Print the Cylc header including the CLI logo."""
564+
"""Print the Cylc header including the CLI logo to the user's terminal."""
565565
if (
566566
cylc.flow.flags.verbosity > -1
567567
and (options.no_detach or options.format == 'plain')
568+
# don't print the startup message on reinvocation (note
569+
# --host=localhost is the best indication we have that reinvokation has
570+
# happened)
571+
and options.host != 'localhost'
568572
):
569573
print(
570574
cparse(

0 commit comments

Comments
 (0)