Format code

This commit is contained in:
nicolargo 2024-11-01 07:37:54 +01:00
parent 6ee3683172
commit 63c7cfcfe8
3 changed files with 5 additions and 4 deletions

View File

@ -264,7 +264,7 @@ class PodmanExtension:
self.connect()
def connect(self):
"""Connect to Podman."""
"""Connect to Podman."""
try:
self.client = PodmanClient(base_url=self.podman_sock)
# PodmanClient works lazily, so make a ping to determine if socket is open

View File

@ -16,9 +16,10 @@ NVML_LIB = 'libnvidia-ml.so.1'
try:
# Avoid importing pynvml if NVML_LIB is not installed
from ctypes import CDLL
CDLL(NVML_LIB)
import pynvml
except OSError as e:
except OSError:
nvidia_gpu_enable = False
# NNVML_LIB lib not found (NVidia driver not installed)
logger.warning(f"NVML Shared Library ({NVML_LIB}) not Found, Nvidia GPU plugin is disabled")

View File

@ -537,9 +537,9 @@ class GlancesProcesses:
# Remove non running process from the cache (avoid issue #2976)
pids_running = [p['pid'] for p in processlist]
pids_cached = [p for p in self.processlist_cache.keys()]
pids_cached = self.processlist_cache.keys()
for pid in pids_cached:
if pid not in pids_running:
if pid not in pids_running:
self.processlist_cache.pop(pid, None)
# Filter and transform process export list