Skip to content

Commit

Permalink
remove docker_ip
Browse files Browse the repository at this point in the history
  • Loading branch information
worxli committed Nov 30, 2018
1 parent 015243f commit ca73fbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions python/topology/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# Stdlib
import os
import subprocess
# SCION
from lib.packet.scion_addr import ISD_AS

Expand Down Expand Up @@ -116,3 +117,7 @@ def docker_image(args, image):
if args.image_tag:
image = '%s:%s' % (image, args.image_tag)
return image


def docker_ip():
return subprocess.check_output(['tools/docker-ip']).decode("utf-8").strip()
9 changes: 2 additions & 7 deletions python/topology/topo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import logging
import os
import random
import subprocess
import sys
from collections import defaultdict

Expand All @@ -42,7 +41,7 @@
from lib.topology import Topology
from lib.types import LinkType
from lib.util import write_file
from topology.common import srv_iter, ArgsBase, TopoID, SCION_SERVICE_NAMES
from topology.common import srv_iter, ArgsBase, docker_ip, TopoID, SCION_SERVICE_NAMES
from topology.net import AddressProxy

DEFAULT_LINK_BW = 1000
Expand Down Expand Up @@ -309,7 +308,7 @@ def _gen_zk_entry(self, addr, port, in_docker, docker):
elif docker or not addr:
# Using docker topology or there is no default addr,
# we directly get the DOCKER0 IP
addr = _docker_ip()
addr = docker_ip()
else:
# Addr is specified in the topo file
addr = str(ip_address(addr))
Expand Down Expand Up @@ -397,7 +396,3 @@ def _json_default(o):
if isinstance(o, AddressProxy):
return str(o.ip)
raise TypeError


def _docker_ip():
return subprocess.check_output(['tools/docker-ip']).decode("utf-8").strip()

0 comments on commit ca73fbe

Please sign in to comment.