1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

docker_: ignore contains which are not running

Some containers may be in "restarting" state.  We should ignore these.

Thanks, ogmueller!

Closes: #1209
This commit is contained in:
Lars Kruse 2021-07-14 22:20:51 +02:00
parent a3ae1af155
commit c633ff00ea

View file

@ -143,9 +143,10 @@ class ClientWrapper:
@cached_property
@sorted_by_creation_date
def all_containers(self):
return [c for c in self.client.containers.list(all=True)
if not self.exclude
or not self.exclude.search(c.name)]
return [
c for c in self.client.containers.list(all=True)
if (c.status == 'running') and (not self.exclude or not self.exclude.search(c.name))
]
@cached_property
@sorted_by_creation_date