name docker interfaces according to start_compute option
diff --git a/src/emuvim/dcemulator/net.py b/src/emuvim/dcemulator/net.py
index 4028a26..ed40545 100755
--- a/src/emuvim/dcemulator/net.py
+++ b/src/emuvim/dcemulator/net.py
@@ -124,12 +124,13 @@
if isinstance(node1, Docker):
if "id" in params["params1"]:
node1_port_id = params["params1"]["id"]
+ node1_port_name = link.intf1.name
node2_port_id = node2.ports[link.intf2]
if isinstance(node2, Docker):
if "id" in params["params2"]:
node2_port_id = params["params2"]["id"]
-
+ node2_port_name = link.intf2.name
# add edge and assigned port number to graph in both directions between node1 and node2
@@ -150,13 +151,17 @@
attr_dict[attr] = attr_number
- attr_dict2 = {'src_port_id': node1_port_id, 'src_port': node1.ports[link.intf1],
- 'dst_port_id': node2_port_id, 'dst_port': node2.ports[link.intf2]}
+ attr_dict2 = {'src_port_id': node1_port_id, 'src_port_nr': node1.ports[link.intf1],
+ 'src_port_name': node1_port_name,
+ 'dst_port_id': node2_port_id, 'dst_port_nr': node2.ports[link.intf2],
+ 'dst_port_name': node2_port_name}
attr_dict2.update(attr_dict)
self.DCNetwork_graph.add_edge(node1.name, node2.name, attr_dict=attr_dict2)
- attr_dict2 = {'src_port_id': node2_port_id, 'src_port': node2.ports[link.intf2],
- 'dst_port_id': node1_port_id, 'dst_port': node1.ports[link.intf1]}
+ attr_dict2 = {'src_port_id': node2_port_id, 'src_port_nr': node2.ports[link.intf2],
+ 'src_port_name': node2_port_name,
+ 'dst_port_id': node1_port_id, 'dst_port_nr': node1.ports[link.intf1],
+ 'dst_port_name': node1_port_name}
attr_dict2.update(attr_dict)
self.DCNetwork_graph.add_edge(node2.name, node1.name, attr_dict=attr_dict2)
diff --git a/src/emuvim/dcemulator/node.py b/src/emuvim/dcemulator/node.py
index 2943b6d..09dca9c 100755
--- a/src/emuvim/dcemulator/node.py
+++ b/src/emuvim/dcemulator/node.py
@@ -167,11 +167,10 @@
# connect all given networks
# if no --net option is given, network = [{}], so 1 empty dict in the list
# this results in 1 default interface with a default ip address
- logging.info('nwlist: {0}'.format(network))
for nw in network:
# TODO we cannot use TCLink here (see: https://github.com/mpeuster/dockernet/issues/3)
logging.info('nw: {0}'.format(nw))
- self.net.addLink(d, self.switch, params1=nw, cls=Link)
+ self.net.addLink(d, self.switch, params1=nw, cls=Link, intfName1=nw.get('id'))
# do bookkeeping
self.containers[name] = d
return d # we might use UUIDs for naming later on