From dd5b689629437bfa1c40d00ae40d664c5f19b0d5 Mon Sep 17 00:00:00 2001 From: "Chornyi, TarasX" Date: Fri, 28 Sep 2018 11:43:19 +0300 Subject: Fix python lib path for ixload control subprocess JIRA: YARDSTICK-1390 Change-Id: I3ef5242862c98d3b389ba127f909f47e26c0711d Signed-off-by: Chornyi, TarasX (cherry picked from commit 376720a9ff56a9e71b6bc63b1d621f0c600088e1) --- yardstick/network_services/traffic_profile/http_ixload.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit 1.2.3-korg