diff --git a/daemon/core/emulator/emudata.py b/daemon/core/emulator/emudata.py index e739800e..792a896f 100644 --- a/daemon/core/emulator/emudata.py +++ b/daemon/core/emulator/emudata.py @@ -29,7 +29,7 @@ def create_interface(node, network, interface_data): ifindex=interface_data.id, ifname=interface_data.name, ) - return node.netif(interface_data.id, network) + return node.netif(interface_data.id) def link_config(network, interface, link_options, devname=None, interface_two=None): diff --git a/daemon/core/emulator/session.py b/daemon/core/emulator/session.py index e3b00695..6d74f0cd 100644 --- a/daemon/core/emulator/session.py +++ b/daemon/core/emulator/session.py @@ -594,11 +594,11 @@ class Session(object): raise CoreError("modify link for unknown nodes") elif not node_one: # node1 = layer 2node, node2 = layer3 node - interface = node_two.netif(interface_two_id, net_one) + interface = node_two.netif(interface_two_id) link_config(net_one, interface, link_options) elif not node_two: # node2 = layer 2node, node1 = layer3 node - interface = node_one.netif(interface_one_id, net_one) + interface = node_one.netif(interface_one_id) link_config(net_one, interface, link_options) else: common_networks = node_one.commonnets(node_two) diff --git a/daemon/core/nodes/base.py b/daemon/core/nodes/base.py index d0ada65c..aadd2348 100644 --- a/daemon/core/nodes/base.py +++ b/daemon/core/nodes/base.py @@ -294,7 +294,6 @@ class CoreNodeBase(NodeBase): if ifindex in self._netif: raise ValueError(f"ifindex {ifindex} already exists") self._netif[ifindex] = netif - # TODO: this should have probably been set ahead, seems bad to me, check for failure and fix netif.netindex = ifindex def delnetif(self, ifindex): @@ -310,13 +309,11 @@ class CoreNodeBase(NodeBase): netif.shutdown() del netif - # TODO: net parameter is not used, remove - def netif(self, ifindex, net=None): + def netif(self, ifindex): """ Retrieve network interface. :param int ifindex: index of interface to retrieve - :param core.nodes.interface.CoreInterface net: network node :return: network interface, or None if not found :rtype: core.nodes.interface.CoreInterface """ diff --git a/daemon/core/nodes/network.py b/daemon/core/nodes/network.py index e57a0a95..0a5a0b7b 100644 --- a/daemon/core/nodes/network.py +++ b/daemon/core/nodes/network.py @@ -337,8 +337,6 @@ class CoreNetwork(CoreNetworkBase): del self.session self.up = False - # TODO: this depends on a subtype with localname defined, seems like the - # wrong place for this to live def attach(self, netif): """ Attach a network interface. @@ -1064,7 +1062,7 @@ class WlanNode(CoreNetwork): """ Attach a network interface. - :param core.nodes.interface.CoreInterface netif: network interface + :param core.nodes.interface.Veth netif: network interface :return: nothing """ CoreNetwork.attach(self, netif)