From ee2bce20e73c2ce9c0277bb5cc9bd96d1c99e9df Mon Sep 17 00:00:00 2001 From: nicolargo Date: Mon, 31 Oct 2016 18:32:40 +0100 Subject: [PATCH] Resolv compatibility issue with 2.7 or lower in client/server mode (round 1) --- glances/stats_server.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/glances/stats_server.py b/glances/stats_server.py index 57d96256..0f683396 100644 --- a/glances/stats_server.py +++ b/glances/stats_server.py @@ -51,20 +51,8 @@ class GlancesStatsServer(GlancesStats): def _set_stats(self, input_stats): """Set the stats to the input_stats one.""" # Build the all_stats with the get_raw() method of the plugins - ret = collections.defaultdict(dict) - for p in self._plugins: - ret[p] = self._plugins[p].get_raw() - return ret + return {p: self._plugins[p].get_raw() for p in self._plugins if self._plugins[p].is_enable()} def getAll(self): """Return the stats as a list.""" return self.all_stats - - def getAllAsDict(self): - """Return the stats as a dict.""" - # Python > 2.6 - # return {p: self.all_stats[p] for p in self._plugins} - ret = {} - for p in self._plugins: - ret[p] = self.all_stats[p] - return ret