updated netif function to remove net parameter, since it was not used
This commit is contained in:
parent
3dccd073f2
commit
39c40d2a8c
4 changed files with 5 additions and 10 deletions
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
"""
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue