summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorHieu LE <hieulq@vn.fujitsu.com>2016-05-09 12:29:44 +0700
committerHieu LE <hieulq@vn.fujitsu.com>2016-05-09 12:29:44 +0700
commitb8432408e68855d7ce9269b7e681de3c5b733b09 (patch)
tree65af18e649ea21a0e32e31d6a9b6eb274c0d8647 /openstackclient
parent4cd702c3610e4e6b40695ff9ea8eecf7c0735c68 (diff)
downloadpython-openstackclient-b8432408e68855d7ce9269b7e681de3c5b733b09.tar.gz
Ignore domain related config when using with keystone v2
Currently, "/usr/bin/openstack --insecure token issue" fails when OS_AUTH_URL and OS_IDENTITY_API_VERSION indicate keystone v2 if OS_PROJECT_DOMAIN_NAME or OS_USER_DOMAIN_NAME are set. This patchset ignore domain related configs if using with keystone v2 and print warning for each ignored config. Change-Id: I8afbda787df7855c3f8e868b0f07cbf3b9cd97fd Closes-bug: #1447704
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/common/clientmanager.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py
index c29bf224..9c2b320c 100644
--- a/openstackclient/common/clientmanager.py
+++ b/openstackclient/common/clientmanager.py
@@ -200,12 +200,12 @@ class ClientManager(object):
# ignore all domain related configs.
if (self._api_version.get('identity') == '2.0' and
self.auth_plugin_name.endswith('password')):
- LOG.warning("Ignoring domain related configs "
- "because identity API version is 2.0")
domain_props = ['project_domain_name', 'project_domain_id',
'user_domain_name', 'user_domain_id']
for prop in domain_props:
- self._auth_params.pop(prop, None)
+ if self._auth_params.pop(prop, None) is not None:
+ LOG.warning("Ignoring domain related configs " +
+ prop + " because identity API version is 2.0")
# For compatibility until all clients can be updated
if 'project_name' in self._auth_params: