diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2017-02-24 10:55:05 +0100 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2017-02-24 10:55:05 +0100 |
commit | a29752882898c3ac0ea7a554b7bd0e90899fb5d1 (patch) | |
tree | 689e882e5717ea7062ec9c9a8672a4809cbac0b6 | |
parent | c5e3e0d0249bd2d2c7788d282dc00f13bd427dcb (diff) |
bugfix: manage unhomogeneous OS_AUTH_URL
the installers may use different format for the URL
use regex to retrieve the IP and the port
then build properly the V2 URL
Change-Id: I731d634eceb8f828ff5a22b2f800ee51c06fc341
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
-rw-r--r-- | promise/test/functest/run_tests.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/promise/test/functest/run_tests.py b/promise/test/functest/run_tests.py index dee1c31..40074a8 100644 --- a/promise/test/functest/run_tests.py +++ b/promise/test/functest/run_tests.py @@ -10,11 +10,11 @@ import argparse import json import os +import re import subprocess import time import functest.utils.functest_logger as ft_logger -import functest.utils.functest_utils as ft_utils import functest.utils.openstack_utils as os_utils from functest.utils.constants import CONST @@ -58,8 +58,6 @@ logger = ft_logger.Logger("promise").getLogger() def main(): - start_time = time.time() - change_keystone_version = False os_auth = os.environ["OS_AUTH_URL"] @@ -67,7 +65,15 @@ def main(): # if keystone v3, for keystone v2 if os_utils.is_keystone_v3(): os.environ["OS_IDENTITY_API_VERSION"] = "2" - os.environ["OS_AUTH_URL"] = os.environ["OS_AUTH_URL"] + "/v2.0" + # the OS_AUTH_URL may have different format according to the installer + # apex: OS_AUTH_URL=http://192.168.37.17:5000/v2.0 + # fuel: OS_AUTH_URL='http://192.168.0.2:5000/' + # OS_AUTH_URL='http://192.168.10.2:5000/v3 + match = re.findall(r'[0-9]+(?:\.[0-9]+){3}:[0-9]+', + os.environ["OS_AUTH_URL"]) + new_url = "http://" + match[0] + "/v2.0" + + os.environ["OS_AUTH_URL"] = new_url change_keystone_version = True logger.info("Force Keystone v2") |