From cdf998fa7958ac988c93891ce53a0cc7d92aa7e5 Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Tue, 5 Apr 2022 17:27:40 +0200 Subject: [PATCH] cli - deprecated setting verbosity before sub command, cont'd (#77456) Follow up on #75840 --- lib/ansible/cli/galaxy.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index 5896f3b573c..9ddd2a4e11b 100755 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -171,9 +171,7 @@ class GalaxyCLI(CLI): # Inject role into sys.argv[1] as a backwards compatibility step if args[1] not in ['-h', '--help', '--version'] and 'role' not in args and 'collection' not in args: # TODO: Should we add a warning here and eventually deprecate the implicit role subcommand choice - # Remove this in Ansible 2.13 when we also remove -v as an option on the root parser for ansible-galaxy. - idx = 2 if args[1].startswith('-v') else 1 - args.insert(idx, 'role') + args.insert(1, 'role') self._implicit_role = True # since argparse doesn't allow hidden subparsers, handle dead login arg from raw args after "role" normalization if args[1:3] == ['role', 'login']: