diff --git a/zoe_master/backends/swarm/api_client.py b/zoe_master/backends/swarm/api_client.py index a7fef8f983c3620e1b6564827acd478c2c26b559..a1def3f98e2f8fb64ea01a221b325481a77c6229 100644 --- a/zoe_master/backends/swarm/api_client.py +++ b/zoe_master/backends/swarm/api_client.py @@ -218,9 +218,12 @@ class SwarmClient: "id": container.id, "ip_address": {}, "name": container.name, - 'host': container.attrs['Node']['Name'], 'labels': container.attrs['Config']['Labels'] } # type: Dict[str, Any] + try: + info['host'] = container.attrs['Node']['Name'], + except KeyError: + info['host'] = 'N/A' for net in container.attrs["NetworkSettings"]["Networks"]: if len(container.attrs["NetworkSettings"]["Networks"][net]['IPAddress']) > 0: