Fis issue related to keystone version check

Change-Id: I271f39b320aec080e84c47b41b53d32be6879af2
This commit is contained in:
arunmani 2018-03-09 03:21:04 -05:00
parent 9ed13036de
commit 6bc81b7b28
1 changed files with 2 additions and 2 deletions

View File

@ -779,10 +779,10 @@ class Utils(object):
constants.DEFAULT_STAGING_PROJECT_NAME
try:
projects = []
if hasattr(ks_client, 'v2') or hasattr(ks_client, 'v2.0'):
if ks_client.version in ['v2', 'v2.0']:
# For keystone V2
projects = ks_client.tenants.list()
elif hasattr(ks_client, 'v3') or hasattr(ks_client, 'v3.0'):
elif ks_client.version in ['v3', 'v3.0']:
# For keystone V3
projects = ks_client.projects.list()
for tenant in projects: