diff options
author | muffl0n <sven@schliesing.de> | 2015-08-20 10:31:48 +0200 |
---|---|---|
committer | Brian Coca <brian.coca+git@gmail.com> | 2016-01-06 11:54:19 -0500 |
commit | 21775d7866c7953d4d953c271c0a18e227e4bc66 (patch) | |
tree | d11518fc8e04cfa962794bafa84c0cb511d0a6dd | |
parent | ab536c8aa8dd1d361ba34bbf00c8301d6210452b (diff) | |
download | ansible-21775d7866c7953d4d953c271c0a18e227e4bc66.tar.gz |
Show version without supplying a dummy action
fixes #12004
parsing x2 does not seem to break anything
-rw-r--r-- | lib/ansible/cli/galaxy.py | 7 | ||||
-rw-r--r-- | lib/ansible/cli/vault.py | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index 34afa03c9f..a73fafeb02 100644 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -50,7 +50,7 @@ class GalaxyCLI(CLI): SKIP_INFO_KEYS = ("name", "description", "readme_html", "related", "summary_fields", "average_aw_composite", "average_aw_score", "url" ) VALID_ACTIONS = ("delete", "import", "info", "init", "install", "list", "login", "remove", "search", "setup") - + def __init__(self, args): self.api = None self.galaxy = None @@ -64,6 +64,9 @@ class GalaxyCLI(CLI): epilog = "\nSee '%s <command> --help' for more information on a specific command.\n\n" % os.path.basename(sys.argv[0]) ) + # Workaround for #12004: show version without supplying a dummy action + self.parser.parse_args() + self.set_action() # options specific to actions @@ -141,7 +144,7 @@ class GalaxyCLI(CLI): return True def run(self): - + super(GalaxyCLI, self).run() # if not offline, get connect to galaxy api diff --git a/lib/ansible/cli/vault.py b/lib/ansible/cli/vault.py index 9908f17e57..50a6fdebdc 100644 --- a/lib/ansible/cli/vault.py +++ b/lib/ansible/cli/vault.py @@ -53,6 +53,9 @@ class VaultCLI(CLI): epilog = "\nSee '%s <command> --help' for more information on a specific command.\n\n" % os.path.basename(sys.argv[0]) ) + # Workaround for #12004: show version without supplying a dummy action + self.parser.parse_args() + self.set_action() # options specific to self.actions |