mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-21 16:16:31 +00:00
Only get stats for running containers (#3268)
This commit is contained in:
parent
5d4ce94155
commit
8458d9e0f6
@ -528,6 +528,10 @@ class DockerInterface(CoreSysAttributes):
|
||||
except (docker.errors.DockerException, requests.RequestException) as err:
|
||||
raise DockerError() from err
|
||||
|
||||
# container is not running
|
||||
if docker_container.status != "running":
|
||||
raise DockerError(f"Container {self.name} is not running", _LOGGER.error)
|
||||
|
||||
try:
|
||||
stats = docker_container.stats(stream=False)
|
||||
return DockerStats(stats)
|
||||
|
Loading…
x
Reference in New Issue
Block a user