summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/keystone_utils.py
diff options
context:
space:
mode:
authorGeorg Kunz <georg.kunz@ericsson.com>2018-01-29 16:24:48 +0100
committerGeorg Kunz <georg.kunz@ericsson.com>2018-01-29 20:04:25 +0100
commit0cb9752f2cafb4abc7a5df969becb86ce34d6aa7 (patch)
tree1b83aa21b737d4351b0c25ed39641bd958fae866 /snaps/openstack/utils/keystone_utils.py
parentb4ddabd5af178f0e8bc33fb694facb20fea354ea (diff)
Avoid checking Keystone v3 domains when using API v2.0
Introducing a version check to avoid checking keystone domains, which are an auth API v3 feature, when only auth API v2.0 is being used. Change-Id: I220c6637e5f65124e5dbe7d5246490c3986b7a66 Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
Diffstat (limited to 'snaps/openstack/utils/keystone_utils.py')
-rw-r--r--snaps/openstack/utils/keystone_utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/snaps/openstack/utils/keystone_utils.py b/snaps/openstack/utils/keystone_utils.py
index b8769c0..6262d06 100644
--- a/snaps/openstack/utils/keystone_utils.py
+++ b/snaps/openstack/utils/keystone_utils.py
@@ -381,9 +381,10 @@ def get_domain_by_id(keystone, domain_id):
:param domain_id: the domain ID to retrieve
:return: the SNAPS-OO Domain domain object
"""
- domain = keystone.domains.get(domain_id)
- if domain:
- return Domain(name=domain.name, domain_id=domain.id)
+ if keystone.version != V2_VERSION_STR:
+ domain = keystone.domains.get(domain_id)
+ if domain:
+ return Domain(name=domain.name, domain_id=domain.id)
def __get_os_domain_by_name(keystone, domain_name):