From 705b9d51a9d81ca75b07f71c09d9a4e9f35ed49a Mon Sep 17 00:00:00 2001 From: Thomas Duval Date: Wed, 7 Sep 2016 14:09:19 +0200 Subject: Update subprocess code to be compliant with Python2 and update credentials for Swift Moonclient test. Change-Id: I571f3c48765da02ed7ad6c23b006afe0f97a8636 --- tests/run_tests.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/run_tests.py b/tests/run_tests.py index 7c48e268..012e173d 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -49,14 +49,14 @@ except ImportError: def __get_endpoint_url(name="keystone"): - with subprocess.Popen(["openstack", "endpoint", "show", name, "-f", "yaml"], stdout=subprocess.PIPE) as proc: - y = yaml.load(proc.stdout.read()) - url = y['publicurl'] - url = url.replace("http://", "") - url = url.replace("https://", "") - host, port = url.split(":", maxsplit=1) - port = port.split("/")[0] - return host, port + proc = subprocess.Popen(["openstack", "endpoint", "show", name, "-f", "yaml"], stdout=subprocess.PIPE) + y = yaml.load(proc.stdout.read()) + url = y['publicurl'] + url = url.replace("http://", "") + url = url.replace("https://", "") + host, port = url.split(":") + port = port.split("/")[0] + return host, port def test_federation(): -- cgit 1.2.3-korg