From aa154055552ed0f964e7a3400672e569778617f4 Mon Sep 17 00:00:00 2001 From: Luz Cazares Date: Tue, 3 Oct 2017 23:34:58 +0000 Subject: [PATCH] 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 --- refstack_client/refstack_client.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/refstack_client/refstack_client.py b/refstack_client/refstack_client.py index 927a4ab..da866b3 100755 --- a/refstack_client/refstack_client.py +++ b/refstack_client/refstack_client.py @@ -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')