diff options
author | Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> | 2023-05-14 02:04:45 +0530 |
---|---|---|
committer | Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> | 2023-05-14 02:20:16 +0530 |
commit | b1da4f6ff418643e43c659ca3d5eb3fc9e7d4ea1 (patch) | |
tree | 28435bb33f18332a4b1ec45cd64207792f2fdb4a | |
parent | bce5d7e6dfc95bf919bddab406fe4f461b9199dd (diff) |
chg: containers (podman) - check for open socket eagerly
objective: Know if a podman sock is open. If not, stop pinging it every update
-rw-r--r-- | glances/plugins/containers/glances_podman.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/glances/plugins/containers/glances_podman.py b/glances/plugins/containers/glances_podman.py index a3caa0d9..f2038343 100644 --- a/glances/plugins/containers/glances_podman.py +++ b/glances/plugins/containers/glances_podman.py @@ -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 |