Added decode('ascii') to results from subprocess

This commit is contained in:
Domen Tabernik 2020-07-28 14:58:54 +02:00 committed by GitHub
parent be39c56a10
commit 055ab5f833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -190,6 +190,9 @@ def ipmi_raw_cmd(raw_cmd, hostname = 'localhost', username=None, password=None,
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,6 +220,8 @@ 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"):