Skip to content

Commit

Permalink
- small re-word
Browse files Browse the repository at this point in the history
- added SUPPRESS for auto-approve
  • Loading branch information
gabrielcocenza committed Jan 19, 2024
1 parent db6c650 commit a5d10c5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cou/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit a5d10c5

Please sign in to comment.