Change auth_url setup according to Tempest docs

Refstack-client fails when tempest value "api_v3" under section
identity_feature_group is not set. But according to Tempest docs:
https://docs.openstack.org/tempest/latest/configuration.html#keystone-connection-info
api_v3 is not required to stablish a connection with keystone.
Furthermore it defaults to True which will enable v3 features
unless explicitly set to False.

This fix simplifies the way we set auth_url

Change-Id: I1a4ea9cdcc625f94f978e1a929de1f543000051d
This commit is contained in:
Luz Cazares 2017-10-03 23:34:58 +00:00
parent 4e187b0767
commit aa15405555

View File

@ -147,23 +147,20 @@ class RefstackClient:
return os.path.join(tempest_dir, '.testrepository', subunit_file)
def _get_keystone_config(self, conf_file):
'''This will get and return the keystone configs
from config file.'''
'''This will get and return the keystone configs from config file.'''
try:
# Prefer Keystone V3 API if it is enabled
auth_version = (
'v3' if (conf_file.has_option('identity-feature-enabled',
'api_v3') and
conf_file.getboolean('identity-feature-enabled',
'api_v3') and
conf_file.has_option('identity', 'uri_v3'))
else 'v2')
auth_version = 'v3'
if conf_file.has_option('identity', 'auth_version'):
auth_version = conf_file.get('identity', 'auth_version')
if auth_version == 'v2':
auth_url = '%s/tokens' % (conf_file.get('identity', 'uri')
.rstrip('/'))
elif auth_version == 'v3':
auth_url = '%s/auth/tokens' % (conf_file.get('identity',
'uri_v3').rstrip('/'))
domain_name = 'Default'
if conf_file.has_option('identity', 'domain_name'):
domain_name = conf_file.get('identity', 'domain_name')