mirror of https://github.com/nicolargo/glances.git
chg: containers (podman) - check for open socket eagerly
objective: Know if a podman sock is open. If not, stop pinging it every update
This commit is contained in:
parent
bce5d7e6df
commit
b1da4f6ff4
|
|
@ -230,6 +230,8 @@ class PodmanContainersExtension:
|
|||
"""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
|
||||
self.client.ping()
|
||||
except Exception as e:
|
||||
logger.error("{} plugin - Can't connect to Podman ({})".format(self.ext_name, e))
|
||||
self.client = None
|
||||
|
|
|
|||
Loading…
Reference in New Issue