aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index 6269540ec..f6b912a60 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -21,6 +21,7 @@ import subprocess
import time
import pkg_resources
+import six
from six.moves import configparser
from xtesting.core import testcase
import yaml
@@ -199,9 +200,16 @@ class TempestCommon(singlevm.VmReady2):
cmd = ("rally verify list-verifiers | awk '/" +
getattr(config.CONF, 'tempest_verifier_name') +
"/ {print $2}'")
- proc = subprocess.Popen(cmd, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
+ if six.PY3:
+ # pylint: disable=no-member
+ proc = subprocess.Popen(
+ cmd, shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.DEVNULL)
+ else:
+ with open(os.devnull, 'wb') as devnull:
+ proc = subprocess.Popen(
+ cmd, shell=True, stdout=subprocess.PIPE,
+ stderr=devnull)
verifier_uuid = proc.stdout.readline().rstrip()
return verifier_uuid.decode("utf-8")