Skip to content

Commit

Permalink
Fix trailing slash in reg (workflow name) bug cylc#4010
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Dec 22, 2020
1 parent 7da14a1 commit dd9c918
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cylc/flow/scheduler_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def scheduler_cli(parser, options, args, is_restart=False):
functionality.
"""
reg = args[0]
reg = os.path.normpath(args[0])
# Check suite is not already running before start of host selection.
try:
suite_files.detect_old_contact_file(reg)
Expand Down
6 changes: 3 additions & 3 deletions cylc/flow/scripts/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@
Broadcast cannot change [runtime] inheritance.
See also 'cylc reload' - reload a modified suite definition at run time."""
import sys

import os.path
import sys
import re

from tempfile import NamedTemporaryFile

from ansimarkup import parse as cparse

from cylc.flow import ID_DELIM
Expand Down Expand Up @@ -296,6 +295,7 @@ def get_option_parser():
@cli_function(get_option_parser)
def main(_, options, suite):
"""Implement cylc broadcast."""
suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
2 changes: 2 additions & 0 deletions cylc/flow/scripts/ext_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
Note: to manually trigger a task use 'cylc trigger', not this command."""

import os.path
from time import sleep

from cylc.flow import LOG
Expand Down Expand Up @@ -89,6 +90,7 @@ def get_option_parser():

@cli_function(get_option_parser)
def main(parser, options, suite, event_msg, event_id):
suite = os.path.normpath(suite)
LOG.info('Send to suite %s: "%s" (%s)', suite, event_msg, event_id)

pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/hold.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
See also 'cylc release'.
"""

import os.path

from cylc.flow.option_parsers import CylcOptionParser as COP
from cylc.flow.network.client import SuiteRuntimeClient
from cylc.flow.terminal import cli_function
Expand Down Expand Up @@ -67,6 +69,7 @@ def get_option_parser():

@cli_function(get_option_parser)
def main(parser, options, suite, *task_globs):
suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/kill.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
$ cylc kill REG TASK_GLOB ... # kill one or more active tasks
"""

import os.path

from cylc.flow.option_parsers import CylcOptionParser as COP
from cylc.flow.network.client import SuiteRuntimeClient
from cylc.flow.terminal import cli_function
Expand Down Expand Up @@ -57,6 +59,7 @@ def get_option_parser():
@cli_function(get_option_parser)
def main(parser, options, suite, *task_globs):
"""CLI of "cylc kill"."""
suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
$ cylc poll REG TASK_GLOB # poll multiple active tasks or families
"""

import os.path

from cylc.flow.option_parsers import CylcOptionParser as COP
from cylc.flow.network.client import SuiteRuntimeClient
from cylc.flow.terminal import cli_function
Expand Down Expand Up @@ -56,6 +58,7 @@ def get_option_parser():

@cli_function(get_option_parser)
def main(parser, options, suite, *task_globs):
suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
See also 'cylc hold'.
"""

import os.path

from cylc.flow.option_parsers import CylcOptionParser as COP
from cylc.flow.network.client import SuiteRuntimeClient
from cylc.flow.terminal import cli_function
Expand Down Expand Up @@ -60,6 +62,7 @@ def get_option_parser():

@cli_function(get_option_parser)
def main(parser, options, suite, *task_globs):
suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
If the modified suite definition does not parse, failure to reload will
be reported but no harm will be done to the running suite."""

import os.path

from cylc.flow.option_parsers import CylcOptionParser as COP
from cylc.flow.network.client import SuiteRuntimeClient
from cylc.flow.terminal import cli_function
Expand All @@ -57,6 +59,7 @@ def get_option_parser():

@cli_function(get_option_parser)
def main(parser, options, suite):
suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"""

import os.path

from cylc.flow.option_parsers import CylcOptionParser as COP
from cylc.flow.network.client import SuiteRuntimeClient
from cylc.flow.terminal import cli_function
Expand Down Expand Up @@ -53,6 +55,7 @@ def get_option_parser():

@cli_function(get_option_parser)
def main(parser, options, suite, *task_globs):
suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/set_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"""

import os.path

from cylc.flow.option_parsers import CylcOptionParser as COP
from cylc.flow.network.client import SuiteRuntimeClient
from cylc.flow.terminal import cli_function
Expand Down Expand Up @@ -66,6 +68,7 @@ def get_option_parser():

@cli_function(get_option_parser)
def main(parser, options, suite, *task_globs):
suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/set_verbosity.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
logged.
"""

import os.path

from cylc.flow import LOG_LEVELS
from cylc.flow.option_parsers import CylcOptionParser as COP
from cylc.flow.network.client import SuiteRuntimeClient
Expand Down Expand Up @@ -64,6 +66,7 @@ def main(parser, options, suite, severity_str):
except KeyError:
parser.error("Illegal logging level, %s" % severity_str)

suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
2 changes: 2 additions & 0 deletions cylc/flow/scripts/stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
This command exits immediately unless --max-polls is greater than zero, in
which case it polls to wait for suite shutdown."""

import os.path
import sys

from cylc.flow.command_polling import Poller
Expand Down Expand Up @@ -151,6 +152,7 @@ def main(parser, options, suite, shutdown_arg=None):
if options.flow_label and int(options.max_polls) > 0:
parser.error("ERROR: --flow is not compatible with --max-polls")

suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

if int(options.max_polls) > 0:
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"""

import os.path

from cylc.flow.option_parsers import CylcOptionParser as COP
from cylc.flow.network.client import SuiteRuntimeClient
from cylc.flow.terminal import cli_function
Expand Down Expand Up @@ -69,6 +71,7 @@ def get_option_parser():
@cli_function(get_option_parser)
def main(parser, options, suite, *task_globs):
"""CLI for "cylc trigger"."""
suite = os.path.normpath(suite)
pclient = SuiteRuntimeClient(suite, timeout=options.comms_timeout)

mutation_kwargs = {
Expand Down
1 change: 1 addition & 0 deletions cylc/flow/task_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def record_messages(suite, task_job, messages):
# Write to job.status
_append_job_status_file(suite, task_job, event_time, messages)
# Send messages
suite = os.path.normpath(suite)
try:
pclient = SuiteRuntimeClient(suite)
except SuiteStopped:
Expand Down

0 comments on commit dd9c918

Please sign in to comment.