Fix small bug on docker network
This commit is contained in:
parent
5d863a503f
commit
9320445074
1 changed files with 3 additions and 1 deletions
|
@ -13,10 +13,12 @@ def get_tor_ips():
|
||||||
|
|
||||||
containers = [
|
containers = [
|
||||||
container for container in 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")
|
and (container.attrs["Config"]["User"] == "tor")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
ip_addrs = [container.attrs['NetworkSettings']['Networks']["net_tor"]["IPAddress"]
|
ip_addrs = [container.attrs['NetworkSettings']['Networks']["net_tor"]["IPAddress"]
|
||||||
for container in containers]
|
for container in containers]
|
||||||
return ip_addrs
|
return ip_addrs
|
||||||
|
|
Loading…
Reference in a new issue