Skip to content

Commit

Permalink
Apply CLI clean changes to correct list
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Mar 7, 2024
1 parent bbd4105 commit 8efc72a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changes.d/6011.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix a VIP bug causing remote re-invocation to fail if workflow id
is set explicitly.
4 changes: 2 additions & 2 deletions cylc/flow/option_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,9 +878,9 @@ def cleanup_sysargv(
new_args[1] = script_name

# replace source path with workflow ID.
if str(source) in sys.argv:
if str(source) in new_args:
new_args.remove(str(source))
if workflow_id not in sys.argv:
if workflow_id not in new_args:
new_args.append(workflow_id)

sys.argv = new_args
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/test_option_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,22 @@ def test_combine_options(inputs, expect):
'play --foo something myworkflow'.split(),
id='no path given'
),
param(
'vip -n myworkflow --no-run-name'.split(),
{
'script_name': 'play',
'workflow_id': 'myworkflow',
'compound_script_opts': [
OptionSettings(['--workflow-name', '-n']),
OptionSettings(['--no-run-name']),
],
'script_opts': [
OptionSettings(['--not-used']),
]
},
'play myworkflow'.split(),
id='workflow-id-added'
),
]
)
def test_cleanup_sysargv(monkeypatch, argv_before, kwargs, expect):
Expand Down

0 comments on commit 8efc72a

Please sign in to comment.