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