From 55c475ed17ae828fa49e1b39738b0ffad20d78c8 Mon Sep 17 00:00:00 2001 From: Jacob Callahan Date: Mon, 14 Oct 2024 14:47:30 -0400 Subject: [PATCH] Small workaround for container syncing In cases, like we currently have, where the container host is podman<5.0 and local podman/podman-py is >=5.0 we run into a TypeError. To solve this, we resort to manually getting the status. --- broker/providers/container.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/broker/providers/container.py b/broker/providers/container.py index da4eeae..08749a4 100644 --- a/broker/providers/container.py +++ b/broker/providers/container.py @@ -17,14 +17,18 @@ def container_info(container_inst): """Return a dict of container information.""" - return { + info = { "_broker_provider": "Container", "name": container_inst.name, "hostname": container_inst.id[:12], "image": container_inst.image.tags, "ports": container_inst.ports, - "status": container_inst.status, } + try: + info["status"] = container_inst.status + except TypeError: + info["status"] = container_inst.attrs["State"] + return info def _host_release():