summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolargo <nicolas@nicolargo.com>2016-09-02 15:25:23 +0200
committerNicolargo <nicolas@nicolargo.com>2016-09-02 15:25:23 +0200
commitfd9cc986deda975aace11f96dc17fa9c60b4b264 (patch)
tree89ea03f9e44fa01d5e29200bca85f4eef883252f
parent97a9365bf87df2a5a9257fb37c686d0f539f83e6 (diff)
Improper bytes/unicode in glances_hddtemp.py #887
-rw-r--r--glances/plugins/glances_hddtemp.py3
-rw-r--r--glances/plugins/glances_sensors.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/glances/plugins/glances_hddtemp.py b/glances/plugins/glances_hddtemp.py
index fcc9c0af..07813f3f 100644
--- a/glances/plugins/glances_hddtemp.py
+++ b/glances/plugins/glances_hddtemp.py
@@ -131,7 +131,8 @@ class GlancesGrabHDDTemp(object):
hddtemp_current['value'] = float(temperature)
except ValueError:
# Temperature could be 'ERR', 'SLP' or 'UNK' (see issue #824)
- hddtemp_current['value'] = temperature
+ # Improper bytes/unicode in glances_hddtemp.py (see issue #887)
+ hddtemp_current['value'] = nativestr(temperature)
hddtemp_current['unit'] = unit
self.hddtemp_list.append(hddtemp_current)
diff --git a/glances/plugins/glances_sensors.py b/glances/plugins/glances_sensors.py
index e20c0ad9..380c0059 100644
--- a/glances/plugins/glances_sensors.py
+++ b/glances/plugins/glances_sensors.py
@@ -183,6 +183,7 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_add_line(msg, "TITLE"))
for i in self.stats:
+ logger.info(i)
# Do not display anything if no battery are detected
if (i['type'] == 'battery' and i['value'] == []):
continue
@@ -197,7 +198,7 @@ class Plugin(GlancesPlugin):
else:
msg = '{:13}'.format(label[:13])
ret.append(self.curse_add_line(msg))
- if i['value'] in (b'ERR', b'SLP', b'UNK'):
+ if i['value'] in (b'ERR', b'SLP', b'UNK', b'NOS'):
msg = '{:>8}'.format(i['value'])
ret.append(self.curse_add_line(
msg, self.get_views(item=i[self.get_key()],