Skip to content

Commit 5df1884

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Ignore domain related config when using with keystone v2"
2 parents f91685f + 59de9c4 commit 5df1884

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

openstackclient/common/clientmanager.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,18 @@ def setup_auth(self, required_scope=True):
195195
not self._auth_params.get('user_domain_name')):
196196
self._auth_params['user_domain_id'] = default_domain
197197

198+
# NOTE(hieulq): If USER_DOMAIN_NAME, USER_DOMAIN_ID, PROJECT_DOMAIN_ID
199+
# or PROJECT_DOMAIN_NAME is present and API_VERSION is 2.0, then
200+
# ignore all domain related configs.
201+
if (self._api_version.get('identity') == '2.0' and
202+
self.auth_plugin_name.endswith('password')):
203+
LOG.warning("Ignoring domain related configs "
204+
"because identity API version is 2.0")
205+
domain_props = ['project_domain_name', 'project_domain_id',
206+
'user_domain_name', 'user_domain_id']
207+
for prop in domain_props:
208+
self._auth_params.pop(prop, None)
209+
198210
# For compatibility until all clients can be updated
199211
if 'project_name' in self._auth_params:
200212
self._project_name = self._auth_params['project_name']

0 commit comments

Comments
 (0)