diff options
| author | Juan Antonio Osorio Robles <juan.osorio.robles@ericsson.com> | 2015-04-27 08:39:21 +0300 |
|---|---|---|
| committer | Juan Antonio Osorio Robles <juan.osorio.robles@ericsson.com> | 2015-04-27 16:54:28 +0300 |
| commit | 48b52a0d40013d65e85ebeadcfb80a06c431b6db (patch) | |
| tree | f522b3e030caff7c37aacab0422cb12c2217a738 /openstackclient/shell.py | |
| parent | 416d840dc4cb00026bac2512b259ce88a0e4a765 (diff) | |
| download | python-openstackclient-48b52a0d40013d65e85ebeadcfb80a06c431b6db.tar.gz | |
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
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 00f4a3c9..90a6f32b 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -24,6 +24,7 @@ import warnings from cliff import app from cliff import command +from cliff import complete from cliff import help import openstackclient @@ -76,6 +77,7 @@ class OpenStackShell(app.App): # Some commands do not need authentication help.HelpCommand.auth_required = False + complete.CompleteCommand.auth_required = False super(OpenStackShell, self).__init__( description=__doc__.strip(), @@ -318,12 +320,8 @@ class OpenStackShell(app.App): cmd.__class__.__name__, ) if cmd.auth_required: - try: - # Trigger the Identity client to initialize - self.client_manager.auth_ref - except Exception as e: - self.log.warning("Possible error authenticating: " + str(e)) - pass + # Trigger the Identity client to initialize + self.client_manager.auth_ref return def clean_up(self, cmd, result, err): |
