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
This commit is contained in:
TerryHowe 2015-04-17 07:54:05 -06:00
parent 52c4e5fa87
commit 15bc2ccec9

View File

@ -280,7 +280,8 @@ class OpenStackShell(app.App):
try: try:
# Trigger the Identity client to initialize # Trigger the Identity client to initialize
self.client_manager.auth_ref self.client_manager.auth_ref
except Exception: except Exception as e:
self.log.warning("Possible error authenticating: " + str(e))
pass pass
return return