Alvaro Uría has proposed merging
~aluria/hw-health-charm/+git/hw-health-charm:lshw-py35 into
hw-health-charm:master.
Requested reviews:
Nagios Charm developers (nagios-charmers)
For more details, see:
https://code.launchpad.net/~aluria/hw-health-charm/+git/hw-health-charm/+merge/364974
--
Your team Nagios Charm developers is requested to review the proposed merge of
~aluria/hw-health-charm/+git/hw-health-charm:lshw-py35 into
hw-health-charm:master.
diff --git a/src/lib/hwhealth/discovery/lshw.py b/src/lib/hwhealth/discovery/lshw.py
index 57981d9..7a2af8f 100644
--- a/src/lib/hwhealth/discovery/lshw.py
+++ b/src/lib/hwhealth/discovery/lshw.py
@@ -17,10 +17,12 @@ class Hardware(object):
with open(self.__filename, 'r') as fd:
hwinfo = json.load(fd)
else:
- output = subprocess.check_output(['lshw', '-json'], encoding='utf-8', errors='ignore')
- hwinfo = json.loads(output)
+ output = subprocess.check_output(['lshw', '-json'])
+ # Note(aluria): py35 does not support extra args on subprocess.check_output
+ output_str = output.decode(errors='ignore')
+ hwinfo = json.loads(output_str)
with open(self.__filename, 'w') as fd:
- fd.write(output)
+ fd.write(output_str)
return hwinfo
except PermissionError as error:
--
Mailing list: https://launchpad.net/~nagios-charmers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~nagios-charmers
More help : https://help.launchpad.net/ListHelp