Skip to content

Commit

Permalink
chg: containers (podman) - check for open socket eagerly
Browse files Browse the repository at this point in the history
objective: Know if a podman sock is open. If not, stop pinging it every update
  • Loading branch information
RazCrimson committed May 13, 2023
1 parent bce5d7e commit b1da4f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions glances/plugins/containers/glances_podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ def connect(self):
"""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
Expand Down

0 comments on commit b1da4f6

Please sign in to comment.