diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2017-01-10 16:20:01 +0100 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2017-01-10 16:20:01 +0100 |
commit | 97201d3607146cc4bbf0812a9933cc5c23cd5d97 (patch) | |
tree | cde2c088f5cc0fd8d11c7edb7aa68b6d3ad3fa47 /functest/opnfv_tests/sdn/onos | |
parent | b58dd104d03db315df1d8c6607e6e8a2cf19aef5 (diff) |
Remove cmd to OpenStack, use python client
JIRA: FUNCTEST-503
Change-Id: Ie92051ec128ad4857862e6125628dac24ce99a2a
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'functest/opnfv_tests/sdn/onos')
-rwxr-xr-x | functest/opnfv_tests/sdn/onos/teston/onos.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/functest/opnfv_tests/sdn/onos/teston/onos.py b/functest/opnfv_tests/sdn/onos/teston/onos.py index 300f56d1..213bdb7d 100755 --- a/functest/opnfv_tests/sdn/onos/teston/onos.py +++ b/functest/opnfv_tests/sdn/onos/teston/onos.py @@ -18,14 +18,15 @@ import datetime import os import re import time +import urlparse import argparse from neutronclient.v2_0 import client as neutronclient +import functest.utils.functest_constants as ft_constants import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils import functest.utils.openstack_utils as openstack_utils -import functest.utils.functest_constants as ft_constants parser = argparse.ArgumentParser() @@ -135,9 +136,9 @@ def GetResult(): def SetOnosIp(): - cmd = "openstack catalog show network | grep publicURL" - cmd_output = os.popen(cmd).read() - OC1 = re.search(r"\d+\.\d+\.\d+\.\d+", cmd_output).group() + # cmd = "openstack catalog show network | grep publicURL" + neutron_url = openstack_utils.get_endpoint(service_type='network') + OC1 = urlparse.urlparse(neutron_url).hostname os.environ['OC1'] = OC1 time.sleep(2) logger.debug("ONOS IP is " + OC1) @@ -180,10 +181,9 @@ def SfcTest(): def GetIp(type): - cmd = "openstack catalog show " + type + " | grep publicURL" - cmd_output = os.popen(cmd).read() - ip = re.search(r"\d+\.\d+\.\d+\.\d+", cmd_output).group() - return ip + # cmd = "openstack catalog show " + type + " | grep publicURL" + url = openstack_utils.get_endpoint(service_type=type) + return urlparse.urlparse(url).hostname def Replace(before, after): |