From 505fa14cd68e13d066a5770a229ba0d7fa88d2a9 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 27 Feb 2015 09:19:12 -0600 Subject: 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 --- openstackclient/shell.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'openstackclient/shell.py') 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 -- cgit v1.2.1