Use simpler API to get health of container

This commit is contained in:
Ayaz Salikhov
2025-03-21 10:11:19 +00:00
parent dcd1c457d3
commit f0ef7e30b2

View File

@@ -57,8 +57,8 @@ class TrackedContainer:
def get_health(self) -> str: def get_health(self) -> str:
assert self.container is not None assert self.container is not None
inspect_results = self.docker_client.api.inspect_container(self.container.name) self.container.reload()
return inspect_results["State"]["Health"]["Status"] # type: ignore return self.container.health # type: ignore
def exec_cmd(self, cmd: str, **kwargs: Any) -> str: def exec_cmd(self, cmd: str, **kwargs: Any) -> str:
assert self.container is not None assert self.container is not None