From 47977fcc323b1bf52a40ab98a7617fb5d638ed96 Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Wed, 4 Mar 2015 15:27:33 +1100 Subject: [PATCH] Raise AttributeError for unknown attributes Not returning a value is the same as returning None. In the event that someone asks ClientManager for an attribute that doesn't exist it should raise AttributeError in the same way as other python objects rather than return an empty value. Change-Id: Id0ee825e6527c831c38e3a671958ded362fb96e1 --- openstackclient/common/clientmanager.py | 2 ++ openstackclient/identity/client.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py index c4307919..748894a9 100644 --- a/openstackclient/common/clientmanager.py +++ b/openstackclient/common/clientmanager.py @@ -54,6 +54,8 @@ class ClientManager(object): for o in auth.OPTIONS_LIST]: return self._auth_params[name[1:]] + raise AttributeError(name) + def __init__( self, cli_options, diff --git a/openstackclient/identity/client.py b/openstackclient/identity/client.py index d10d046d..4127a451 100644 --- a/openstackclient/identity/client.py +++ b/openstackclient/identity/client.py @@ -46,7 +46,6 @@ def make_client(instance): API_VERSIONS) LOG.debug('Instantiating identity client: %s', identity_client) - LOG.debug('Using auth plugin: %s' % instance._auth_plugin) client = identity_client( session=instance.session, region_name=instance._region_name,