|
@ -1,4 +1,5 @@ |
|
|
import logging |
|
|
import logging |
|
|
|
|
|
from weakref import KeyedRef |
|
|
import docker |
|
|
import docker |
|
|
from os.path import join, isdir |
|
|
from os.path import join, isdir |
|
|
from os import getcwd, mkdir |
|
|
from os import getcwd, mkdir |
|
@ -64,7 +65,10 @@ class PypiRepoRunner: |
|
|
docker_host_ip = None |
|
|
docker_host_ip = None |
|
|
for network in self.client.networks.list(): |
|
|
for network in self.client.networks.list(): |
|
|
if network.name == "bridge": |
|
|
if network.name == "bridge": |
|
|
docker_host_ip = network.attrs["IPAM"]["Config"][0]["Gateway"] |
|
|
try: |
|
|
|
|
|
docker_host_ip = network.attrs["IPAM"]["Config"][0]["Gateway"] |
|
|
|
|
|
except KeyError: |
|
|
|
|
|
docker_host_ip = network.attrs["IPAM"]["Config"][0]["Subnet"].replace(".0/16", ".1") |
|
|
if docker_host_ip is None: |
|
|
if docker_host_ip is None: |
|
|
raise RunnerError("Unable to determine Docker host IP") |
|
|
raise RunnerError("Unable to determine Docker host IP") |
|
|
|
|
|
|
|
|