Browse Source

Fix #33

master
Daniel Gyulai 3 years ago
parent
commit
ebf8d74843
  1. 2
      alice-ci/setup.cfg
  2. 6
      alice-ci/src/alice/runners/pypirepo.py

2
alice-ci/setup.cfg

@ -1,6 +1,6 @@
[metadata] [metadata]
name = alice-ci name = alice-ci
version = 0.0.12 version = 0.0.13
author = Daniel Gyulai author = Daniel Gyulai
description = Alice CI framework description = Alice CI framework
long_description = file: README.md long_description = file: README.md

6
alice-ci/src/alice/runners/pypirepo.py

@ -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")

Loading…
Cancel
Save