Skip to content

Commit

Permalink
set: fix validation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders committed Jun 14, 2024
1 parent eb97b2f commit bf84ad4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 7 additions & 4 deletions cylc/flow/command_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,22 @@ def prereqs(prereqs: Optional[List[str]]):
['1/foo:succeeded']
# Error: invalid format:
>>> prereqs(["fish"])
>>> prereqs(["fish", "dog"])
Traceback (most recent call last):
cylc.flow.exceptions.InputError: ...
* fish
* dog
# Error: invalid format:
>>> prereqs(["1/foo::bar"])
Traceback (most recent call last):
cylc.flow.exceptions.InputError: ...
* 1/foo::bar
# Error: "all" must be used alone:
>>> prereqs(["all", "2/foo:baz"])
Traceback (most recent call last):
cylc.flow.exceptions.InputError: ...
cylc.flow.exceptions.InputError: --pre=all must be used alone
"""
if prereqs is None:
Expand All @@ -122,8 +125,8 @@ def prereqs(prereqs: Optional[List[str]]):
bad.append(pre)
if bad:
raise InputError(
"Use prerequisite format <cycle-point>/<task>:output\n"
"\n ".join(bad)
"Use prerequisite format <cycle>/<task>:output\n * "
+ "\n * ".join(bad)
)

if len(prereqs2) > 1: # noqa SIM102 (anticipates "cylc set --pre=cycle")
Expand Down
1 change: 0 additions & 1 deletion cylc/flow/scripts/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ async def run(
workflow_id: str,
*tokens_list
):

validate_tokens(tokens_list)

pclient = get_client(workflow_id, timeout=options.comms_timeout)
Expand Down

0 comments on commit bf84ad4

Please sign in to comment.