From 932044507427928cab672f495da132b602c561ef Mon Sep 17 00:00:00 2001 From: Iglesys Date: Mon, 21 Nov 2022 15:19:47 +0100 Subject: [PATCH] Fix small bug on docker network --- conf-generator/gen_conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf-generator/gen_conf.py b/conf-generator/gen_conf.py index 65a6b99..772df78 100644 --- a/conf-generator/gen_conf.py +++ b/conf-generator/gen_conf.py @@ -13,10 +13,12 @@ def get_tor_ips(): containers = [ container for container in containers - if (container.attrs["NetworkSettings"]["Networks"]["net_tor"]["NetworkID"] == net_tor_id) + if ("net_tor" in container.attrs["NetworkSettings"]["Networks"]) + and (container.attrs["NetworkSettings"]["Networks"]["net_tor"]["NetworkID"] == net_tor_id) and (container.attrs["Config"]["User"] == "tor") ] + ip_addrs = [container.attrs['NetworkSettings']['Networks']["net_tor"]["IPAddress"] for container in containers] return ip_addrs