diff --git a/cou/commands.py b/cou/commands.py index d2e68b30..5f00b568 100644 --- a/cou/commands.py +++ b/cou/commands.py @@ -78,9 +78,9 @@ def get_subcommand_common_opts_parser() -> argparse.ArgumentParser: A SUPPRESS default is not inserted into the namespace at the start of parsing. A value is written only if the user used that argument. - Without SUPPRESS a command like: "cou upgrade --force data-plane" wouldn't force the data-plan - to upgrade non-empty hypervisors, because the "child" argument "data-plane" would overwrite - with False. + Without SUPPRESS a command like: "cou upgrade --force data-plane" wouldn't force the data-plane + to upgrade non-empty hypervisors, because the "child" argument "data-plane" would overwrite it + with a default value False. :return: a parser groups options commonly shared by subcommands :rtype: argparse.ArgumentParser @@ -254,6 +254,7 @@ def create_upgrade_subparser( help="Automatically approve and continue with each upgrade step without prompt.", action="store_true", dest="auto_approve", + default=argparse.SUPPRESS, ) upgrade_parser = subparsers.add_parser( "upgrade", diff --git a/tests/unit/test_commands.py b/tests/unit/test_commands.py index f3147003..14005941 100644 --- a/tests/unit/test_commands.py +++ b/tests/unit/test_commands.py @@ -591,6 +591,22 @@ def test_parse_args_plan(args, expected_CLIargs): **{"upgrade_group": "data-plane"} ), ), + ( + ["upgrade", "--auto-approve", "data-plane", "--hostname=1", "-n=2,3"], + CLIargs( + command="upgrade", + model_name=None, + verbosity=0, + quiet=False, + auto_approve=True, + backup=True, + force=False, + machines=None, + hostnames=["1", "2,3"], + availability_zones=None, + **{"upgrade_group": "data-plane"} + ), + ), ( ["upgrade", "data-plane", "--auto-approve", "--force", "--hostname=1", "-n=2,3"], CLIargs(