aboutsummaryrefslogtreecommitdiffstats
path: root/functest
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2020-06-29 13:36:43 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2020-06-29 13:41:57 +0200
commit86fed3e54ff0718745c5c6492bff30ead84ad223 (patch)
tree54d68f6f5890b0ee230f63057e9998ece013bbf6 /functest
parent086ac26fc4224b5a418d31eb1cc5c1c9300987a5 (diff)
Simplify hypervisor list logic in vmtp
It completes the previous change "Allow listing hypervisors in VMTP" [1]. [1] https://gerrit.opnfv.org/gerrit/c/functest/+/70359 Change-Id: I12a19fd473076cfc3262f096cac1615c183710b1 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 06f69562e0937535e665840336b951dbed7ebd1b)
Diffstat (limited to 'functest')
-rw-r--r--functest/opnfv_tests/openstack/vmtp/vmtp.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/functest/opnfv_tests/openstack/vmtp/vmtp.py b/functest/opnfv_tests/openstack/vmtp/vmtp.py
index 93056582b..cfbd134c7 100644
--- a/functest/opnfv_tests/openstack/vmtp/vmtp.py
+++ b/functest/opnfv_tests/openstack/vmtp/vmtp.py
@@ -148,15 +148,14 @@ class Vmtp(singlevm.VmReady2):
del new_env['OS_TENANT_ID']
except Exception: # pylint: disable=broad-except
pass
- extra_args = ""
+ cmd = ['vmtp', '-d', '--json', '{}/vmtp.json'.format(self.res_dir),
+ '-c', self.config]
if env.get("VMTP_HYPERVISORS"):
hypervisors = functest_utils.convert_ini_to_list(
env.get("VMTP_HYPERVISORS"))
for hypervisor in hypervisors:
- extra_args = "{} --hypervisor {} ".format(
- extra_args, hypervisor)
- cmd = ['vmtp', '-d', '--json', '{}/vmtp.json'.format(self.res_dir),
- '-c', self.config, extra_args]
+ cmd.extend(["--hypervisor", hypervisor])
+ self.__logger.debug("cmd: %s", cmd)
output = subprocess.check_output(
cmd, stderr=subprocess.STDOUT, env=new_env).decode("utf-8")
self.__logger.info("%s\n%s", " ".join(cmd), output)