summaryrefslogtreecommitdiffstats
path: root/functest
diff options
context:
space:
mode:
authorJose Lausuch <jose.lausuch@ericsson.com>2017-05-04 12:12:38 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-05-04 12:12:38 +0000
commit983ff4f3c63ed4088392d93e8ed6790fef8af9b7 (patch)
tree3b08f5845da4c918e31825100149c09c0f9f97d0 /functest
parent55d0b662f08ef3c648acfb8d3f1c6f6c71992187 (diff)
parent07add72756bcfbc010887c8c41077c65c8edd5c9 (diff)
Merge "Update rally_conf.json for creating deployment"
Diffstat (limited to 'functest')
-rw-r--r--functest/utils/openstack_utils.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py
index 49b9c840..3b83c3f0 100644
--- a/functest/utils/openstack_utils.py
+++ b/functest/utils/openstack_utils.py
@@ -139,11 +139,11 @@ def get_credentials_for_rally():
endpoint_types = [('internalURL', 'internal'),
('publicURL', 'public'), ('adminURL', 'admin')]
- endpoint_type = os.getenv('OS_ENDPOINT_TYPE')
+ endpoint_type = get_endpoint_type_from_env()
if endpoint_type is not None:
cred_key = env_cred_dict.get('OS_ENDPOINT_TYPE')
for k, v in endpoint_types:
- if endpoint_type == k:
+ if endpoint_type == v:
rally_conf[cred_key] = v
region_name = os.getenv('OS_REGION_NAME')
@@ -158,6 +158,14 @@ def get_credentials_for_rally():
return rally_conf
+def get_endpoint_type_from_env():
+ endpoint_type = os.environ.get("OS_ENDPOINT_TYPE",
+ os.environ.get("OS_INTERFACE"))
+ if endpoint_type and "URL" in endpoint_type:
+ endpoint_type = endpoint_type.replace("URL", "")
+ return endpoint_type
+
+
def get_session_auth(other_creds={}):
loader = loading.get_plugin_loader('password')
creds = get_credentials(other_creds)