diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2015-02-27 09:19:12 -0600 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2015-02-27 17:27:17 -0600 |
| commit | 505fa14cd68e13d066a5770a229ba0d7fa88d2a9 (patch) | |
| tree | 2b7deecebfc03ca94a89536127a206ef658fc2a3 /openstackclient/shell.py | |
| parent | 9400effd4b7653045657630e0909b3dc303ec59e (diff) | |
| download | python-openstackclient-505fa14cd68e13d066a5770a229ba0d7fa88d2a9.tar.gz | |
Fix auth-required for help command
When we got picky with the auth arguments we broke using help without
any auth config supplied. This rearranges things a bit to do the argument
checking when the deferred auth request to Identity occurs so commands
that do not need auth have a chance to live short but useful lives.
Closes-Bug: #1399588
Change-Id: I8ceac491cf65e25eddb62ab2713f471fe686756d
Diffstat (limited to 'openstackclient/shell.py')
| -rw-r--r-- | openstackclient/shell.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py index 246f51b1..b61da2b9 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -22,7 +22,6 @@ import traceback from cliff import app from cliff import command -from cliff import complete from cliff import help import openstackclient @@ -70,10 +69,9 @@ class OpenStackShell(app.App): def __init__(self): # Patch command.Command to add a default auth_required = True command.Command.auth_required = True - command.Command.best_effort = False - # But not help + + # Some commands do not need authentication help.HelpCommand.auth_required = False - complete.CompleteCommand.best_effort = True super(OpenStackShell, self).__init__( description=__doc__.strip(), @@ -294,7 +292,7 @@ class OpenStackShell(app.App): self.verify = not self.options.insecure self.client_manager = clientmanager.ClientManager( - auth_options=self.options, + cli_options=self.options, verify=self.verify, api_version=self.api_version, pw_func=prompt_for_password, @@ -308,7 +306,7 @@ class OpenStackShell(app.App): cmd.__class__.__module__, cmd.__class__.__name__, ) - if cmd.auth_required and cmd.best_effort: + if cmd.auth_required: try: # Trigger the Identity client to initialize self.client_manager.auth_ref |
