Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug preventing cylc vip --workflow-name=foo from working. #5349

Merged
merged 4 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ creating a new release entry be sure to copy & paste the span tag with the
updated. Only the first match gets replaced, so it's fine to leave the old
ones in. -->

-------------------------------------------------------------------------------
## __cylc-8.1.2 (<span actions:bind='release-date'>Coming Soon</span>)__

[#5349](https://github.com/cylc/cylc-flow/pull/5349) - Bugfix: `cylc vip --workflow-name`
only worked when used with a space, not an `=`.

-------------------------------------------------------------------------------
## __cylc-8.1.1 (<span actions:bind='release-date'>Released 2023-01-31</span>)__

Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/option_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,9 @@ def cleanup_sysargv(
not in ['store_true', 'store_false']
):
sys.argv.pop(index)
elif arg in [i.split('=')[0] for i in sys.argv]:
index = [i.split('=')[0] for i in sys.argv].index(arg)
wxtim marked this conversation as resolved.
Show resolved Hide resolved
sys.argv.pop(index)

# replace compound script name:
sys.argv[1] = script_name
Expand Down
13 changes: 13 additions & 0 deletions tests/unit/test_option_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,19 @@ def test_combine_options(inputs, expect):
'play --foo something myworkflow'.split(),
id='no path given'
),
param(
'vip --bar=something'.split(),
{
'script_name': 'play',
'workflow_id': 'myworkflow',
'compound_script_opts': [
OptionSettings(['--bar', '-b'])],
'script_opts': [],
'source': './myworkflow',
},
'play myworkflow'.split(),
id='removes --key=value'
),
]
)
def test_cleanup_sysargv(monkeypatch, argv_before, kwargs, expect):
Expand Down