aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-01-24 16:30:25 -0800
committerRoss Brattain <ross.b.brattain@intel.com>2017-02-06 07:57:36 +0000
commitcdef370df41b6b07018cd27f7549efa4419a5217 (patch)
treea24d310b42a5491b85b59f11952c02ff7d694800
parente599b364ec8925c2e55d9fd6c63a2e5f2c3a89bf (diff)
Fix: network_services: decode stdout instead of encode
Fixes unittest on Python 3 stdout is bytes, so we need to decode bytes to unicode using utf-8 bytes.decode(); str.encode() Change-Id: I4b19d237139f338a648d04aa44cd4f199bb901c3 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
-rw-r--r--yardstick/network_services/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yardstick/network_services/utils.py b/yardstick/network_services/utils.py
index 80e0a631c..b75091326 100644
--- a/yardstick/network_services/utils.py
+++ b/yardstick/network_services/utils.py
@@ -53,7 +53,7 @@ def provision_tool(connection, tool_path):
bin_path = get_nsb_option("bin_path")
exit_status, stdout = connection.execute("which %s" % tool_path)[:2]
if exit_status == 0:
- return encodeutils.safe_encode(stdout, incoming='utf-8').rstrip()
+ return encodeutils.safe_decode(stdout, incoming='utf-8').rstrip()
logging.warning("%s not found on %s, will try to copy from localhost",
tool_path, connection.host)