mirror of
https://github.com/nicolargo/glances.git
synced 2024-08-17 00:10:48 +03:00
3.4.0 crash on startupwith minimal deps #2401
This commit is contained in:
parent
10b5c203d0
commit
230c2fe437
@ -7,3 +7,4 @@ packaging; python_version >= "3.7"
|
||||
python-dateutil
|
||||
six
|
||||
urllib3<2.0 # See issue https://github.com/nicolargo/glances/issues/2392
|
||||
requests # See issue - https://github.com/nicolargo/glances/issues/2233
|
||||
|
@ -10,8 +10,6 @@
|
||||
"""Docker Extension unit for Glances' Containers plugin."""
|
||||
import time
|
||||
|
||||
import requests
|
||||
|
||||
from glances.compat import iterkeys, itervalues, nativestr, pretty_date
|
||||
from glances.logger import logger
|
||||
from glances.plugins.containers.stats_streamer import StatsStreamer
|
||||
@ -19,12 +17,13 @@ from glances.plugins.containers.stats_streamer import StatsStreamer
|
||||
# Docker-py library (optional and Linux-only)
|
||||
# https://github.com/docker/docker-py
|
||||
try:
|
||||
import requests
|
||||
import docker
|
||||
from dateutil import parser, tz
|
||||
except Exception as e:
|
||||
import_docker_error_tag = True
|
||||
# Display debug message if import KeyError
|
||||
logger.debug("Error loading Docker deps Lib. Docker plugin is disabled ({})".format(e))
|
||||
logger.warning("Error loading Docker deps Lib. Docker plugin is disabled ({})".format(e))
|
||||
else:
|
||||
import_docker_error_tag = False
|
||||
|
||||
|
@ -20,7 +20,7 @@ try:
|
||||
except Exception as e:
|
||||
import_podman_error_tag = True
|
||||
# Display debug message if import KeyError
|
||||
logger.debug("Error loading Podman deps Lib. Podman feature in the Containers plugin is disabled ({})".format(e))
|
||||
logger.warning("Error loading Podman deps Lib. Podman feature in the Containers plugin is disabled ({})".format(e))
|
||||
else:
|
||||
import_podman_error_tag = False
|
||||
|
||||
|
@ -158,7 +158,9 @@ class Plugin(GlancesPlugin):
|
||||
msg = '{:>{width}}'.format(self.stats[s], width=max_width - len(s) + 2)
|
||||
ret.append(self.curse_add_line(msg))
|
||||
# Connections track
|
||||
if self.stats['nf_conntrack_enabled']:
|
||||
if self.stats['nf_conntrack_enabled'] and \
|
||||
'nf_conntrack_count' in self.stats and \
|
||||
'nf_conntrack_max' in self.stats:
|
||||
s = 'Tracked'
|
||||
ret.append(self.curse_new_line())
|
||||
msg = '{:{width}}'.format(nativestr(s).capitalize(), width=len(s))
|
||||
|
Loading…
Reference in New Issue
Block a user