From 7f762ad2a6547110aab1170ccf53a032809a4132 Mon Sep 17 00:00:00 2001 From: MendelGusmao Date: Thu, 28 Mar 2013 11:11:40 -0300 Subject: [PATCH] Handling hddtemp error --- glances/glances.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/glances/glances.py b/glances/glances.py index cd29ec8c..5bbad874 100755 --- a/glances/glances.py +++ b/glances/glances.py @@ -750,8 +750,13 @@ class glancesGrabHDDTemp: for i in range(0, devices): offset = i * 5 hddtemp_current = {} - hddtemp_current['label'] = fields[offset + 1].split("/")[-1] - hddtemp_current['value'] = int(fields[offset + 3]) + temperature = fields[offset + 3] + if temperature == "ERR": + hddtemp_current['label'] = "hddtemp error" + hddtemp_current['value'] = 0 + else: + hddtemp_current['label'] = fields[offset + 1].split("/")[-1] + hddtemp_current['value'] = int(temperature) self.hddtemp_list.append(hddtemp_current) def get(self):