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>
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)