(c) 2015 by Manuel Peuster <manuel.peuster@upb.de>
"""
from mininet.node import Docker
+from mininet.link import Link
import logging
self.switch = None # first prototype assumes one "bigswitch" per DC
self.containers = {} # keep track of running containers
+ def __repr__(self):
+ return self.label
+
def _get_next_dc_dpid(self):
global DCDPID_BASE
DCDPID_BASE += 1
d = self.net.addDocker("%s" % (name), dimage=image, dcmd=command)
# connect all given networks
for nw in network:
- self.net.addLink(d, self.switch, params1=nw)
+ # TODO we cannot use TCLink here (see: https://github.com/mpeuster/dockernet/issues/3)
+ self.net.addLink(d, self.switch, params1=nw, cls=Link)
# do bookkeeping
self.containers[name] = d
d.datacenter = self