From a43f24af16de60fde3c2fa0ec312813d48349868 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Tue, 17 Aug 2021 17:33:56 +0200 Subject: [PATCH] DSM 6 docker error crash /sys/class/power_supply #1921 --- glances/__init__.py | 2 +- glances/plugins/sensors/glances_batpercent.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/glances/__init__.py b/glances/__init__.py index 641f0681..ef3ce490 100644 --- a/glances/__init__.py +++ b/glances/__init__.py @@ -29,7 +29,7 @@ import sys # Global name # Version should start and end with a numerical char # See https://packaging.python.org/specifications/core-metadata/#version -__version__ = '3.2.4_Beta01' +__version__ = '3.2.4_Beta02' __author__ = 'Nicolas Hennion ' __license__ = 'LGPLv3' diff --git a/glances/plugins/sensors/glances_batpercent.py b/glances/plugins/sensors/glances_batpercent.py index a77c3b60..fd566b1e 100644 --- a/glances/plugins/sensors/glances_batpercent.py +++ b/glances/plugins/sensors/glances_batpercent.py @@ -56,7 +56,14 @@ class Plugin(GlancesPlugin): stats_init_value=[]) # Init the sensor class - self.glancesgrabbat = GlancesGrabBat() + try: + self.glancesgrabbat = GlancesGrabBat() + except Exception as e: + logger.error("Can not init battery class ({})".format(e)) + global batinfo_tag + global psutil_tag + batinfo_tag = False + psutil_tag = False # We do not want to display the stat in a dedicated area # The HDD temp is displayed within the sensors plugin