aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Lee <limingjiang@huawei.com>2018-11-09 02:01:46 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-11-09 02:01:46 +0000
commit06d14a97d06b5b8a1c20630304fd93439121522f (patch)
treea7d25ab5737d0ee9799bae00cf90dae04b7f8a32
parenteff097a2a6a407d07aac4fa619c768cee320802b (diff)
parentdd5b689629437bfa1c40d00ae40d664c5f19b0d5 (diff)
Merge "Fix python lib path for ixload control subprocess" into stable/gambia
-rw-r--r--yardstick/network_services/traffic_profile/http_ixload.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/yardstick/network_services/traffic_profile/http_ixload.py b/yardstick/network_services/traffic_profile/http_ixload.py
index 6cbdb8ab2..39ee16b42 100644
--- a/yardstick/network_services/traffic_profile/http_ixload.py
+++ b/yardstick/network_services/traffic_profile/http_ixload.py
@@ -16,6 +16,14 @@ import sys
import os
import logging
import collections
+import subprocess
+try:
+ libs = subprocess.check_output(
+ 'python -c "import site; print(site.getsitepackages())"', shell=True)
+
+ sys.path.extend(libs[1:-1].replace("'", "").split(','))
+except subprocess.CalledProcessError:
+ pass
# ixload uses its own py2. So importing jsonutils fails. So adding below
# workaround to support call from yardstick
@@ -24,7 +32,7 @@ try:
except ImportError:
import json as jsonutils
-from yardstick.common import exceptions
+from yardstick.common import exceptions #pylint: disable=wrong-import-position
try:
from IxLoad import IxLoad, StatCollectorUtils