From 2baf0d1de4e60abde00ed1bb643a263b92fd6e82 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 7 May 2017 15:18:48 +0200 Subject: [PATCH] Correct an issue on alert display for CPU and LOAD --- glances/plugins/glances_plugin.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/glances/plugins/glances_plugin.py b/glances/plugins/glances_plugin.py index e9bc9e08..d6107626 100644 --- a/glances/plugins/glances_plugin.py +++ b/glances/plugins/glances_plugin.py @@ -403,11 +403,6 @@ class GlancesPlugin(object): """ ret = {} - value = {'decoration': 'DEFAULT', - 'optional': False, - 'additional': False, - 'splittable': False} - if (isinstance(self.get_raw(), list) and self.get_raw() is not None and self.get_key() is not None): @@ -415,10 +410,18 @@ class GlancesPlugin(object): for i in self.get_raw(): ret[i[self.get_key()]] = {} for key in listkeys(i): + value = {'decoration': 'DEFAULT', + 'optional': False, + 'additional': False, + 'splittable': False} ret[i[self.get_key()]][key] = value elif isinstance(self.get_raw(), dict) and self.get_raw() is not None: # Stats are stored in a dict (ex: CPU, LOAD...) for key in listkeys(self.get_raw()): + value = {'decoration': 'DEFAULT', + 'optional': False, + 'additional': False, + 'splittable': False} ret[key] = value self.views = ret