juju-verify CLI does not allow optional parameters followed by positional args

Bug #1951618 reported by Alvaro Uria
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-verify
Confirmed
Undecided
Unassigned

Bug Description

juju-verify uses argparse to parse the allowed parameters.

The usage section mentions:
"""
usage: juju-verify [-h] [--model MODEL] [-l {trace,debug,info}] [-s] (--units UNITS [UNITS ...] | --machines MACHINES [MACHINES ...]) {shutdown,reboot}
"""

However, due to bug [1], the positional arguments ("{shutdown,reboot}") need to be passed at the beginning of the command.

Example:
"""
# WRONG
$ juju verify -m foundations-maas:test-lma2-microk8s -u microk8s/5 reboot
usage: juju-verify [-h] [--model MODEL] [-l {trace,debug,info}] [-s] (--units UNITS [UNITS ...] | --machines MACHINES [MACHINES ...]) {shutdown,reboot}
juju-verify: error: the following arguments are required: check

# CORRECT
$ juju verify reboot -m foundations-maas:test-lma2-microk8s -u microk8s/5
"""

1. https://bugs.python.org/issue9338

Alvaro Uria (aluria)
Changed in juju-verify:
status: New → Confirmed
Revision history for this message
Alvaro Uria (aluria) wrote :

Alternatively, the "--units" and "--machines" optional arguments (at least one param) should be turned into a single argument (e.g. "--units unit/0,unit/1,..." rather than "--units unit/0 unit/1 ...").

However, the comma-separated approach would be quite different to the one accepted by the juju core CLI tool.

For now, this is just a piece of advice of why the CLI may not work as expected.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.