From 15bc2ccec9ca9df940a548da3cd810a107f45b39 Mon Sep 17 00:00:00 2001 From: TerryHowe Date: Fri, 17 Apr 2015 07:54:05 -0600 Subject: [PATCH] Print warning on authentication error At least print a warning on authentication error. I have no idea why an exception is being ignored here because if there is no session, nothing is going to happen. This at least will print some useful warning: (.venv)terry@f350:~/python-openstackclient$ os flavor list --os-cloud pro WARNING: openstackclient.shell Possible error authenticating: __init__() got an unexpected keyword argument 'asdf' ERROR: openstack Authentication requires 'auth_url', which should be specified in 'HTTPClient' This error was caused by having a bogus value 'asdf' in the cloud.yaml for the cloud pro. Change-Id: Ie08432e0464cfa86b3b3f67ca29d3b7d23d2f46f --- openstackclient/shell.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstackclient/shell.py b/openstackclient/shell.py index c118fbd290..be13d3580b 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -280,7 +280,8 @@ class OpenStackShell(app.App): try: # Trigger the Identity client to initialize self.client_manager.auth_ref - except Exception: + except Exception as e: + self.log.warning("Possible error authenticating: " + str(e)) pass return