Skip to content

Commit 48b52a0

Browse files
author
Juan Antonio Osorio Robles
committed
Raise exception if no session is created
If the clientmanager is unable to create a keystone session (due to insufficient auth parameters or something else) then the exception caused by this shouldn't be ignored, as was the case. On the other hand, we don't want this behaviour in the case of the 'complete' command, so this is now properly detected. Change-Id: If4f453d23cc87900cda752e9ffbcf41ded59e26f Closes-Bug: #1444640
1 parent 416d840 commit 48b52a0

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎openstackclient/shell.py‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
from cliff import app
2626
from cliff import command
27+
from cliff import complete
2728
from cliff import help
2829

2930
import openstackclient
@@ -76,6 +77,7 @@ def __init__(self):
7677

7778
# Some commands do not need authentication
7879
help.HelpCommand.auth_required = False
80+
complete.CompleteCommand.auth_required = False
7981

8082
super(OpenStackShell, self).__init__(
8183
description=__doc__.strip(),
@@ -318,12 +320,8 @@ def prepare_to_run_command(self, cmd):
318320
cmd.__class__.__name__,
319321
)
320322
if cmd.auth_required:
321-
try:
322-
# Trigger the Identity client to initialize
323-
self.client_manager.auth_ref
324-
except Exception as e:
325-
self.log.warning("Possible error authenticating: " + str(e))
326-
pass
323+
# Trigger the Identity client to initialize
324+
self.client_manager.auth_ref
327325
return
328326

329327
def clean_up(self, cmd, result, err):

0 commit comments

Comments
 (0)