From 055ab5f833bb309b63671974d94ecdc7df1a3cd6 Mon Sep 17 00:00:00 2001 From: Domen Tabernik Date: Tue, 28 Jul 2020 14:58:54 +0200 Subject: [PATCH] Added decode('ascii') to results from subprocess --- python/superfans.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/superfans.py b/python/superfans.py index e6c52fd..a897d67 100644 --- a/python/superfans.py +++ b/python/superfans.py @@ -189,7 +189,10 @@ def ipmi_raw_cmd(raw_cmd, hostname = 'localhost', username=None, password=None, print("Command: %s" % cmd) print("Return code: %s" % ex) return False - + + # convert from byte to string format + s = s.decode('ascii') + out = s.strip() if out: return out @@ -217,7 +220,9 @@ def ipmi_fan_status(hostname = 'localhost', username=None, password=None, use_en print("Command: %s" % cmd) print("Return code: %s" % ex) return False - + # convert from byte to string format + s = s.decode('ascii') + fan_status_return = {} for fan_str in s.split("\n"): if len(fan_str.strip()) > 0: