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,
|
ifindex=interface_data.id,
|
||||||
ifname=interface_data.name,
|
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):
|
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")
|
raise CoreError("modify link for unknown nodes")
|
||||||
elif not node_one:
|
elif not node_one:
|
||||||
# node1 = layer 2node, node2 = layer3 node
|
# 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)
|
link_config(net_one, interface, link_options)
|
||||||
elif not node_two:
|
elif not node_two:
|
||||||
# node2 = layer 2node, node1 = layer3 node
|
# 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)
|
link_config(net_one, interface, link_options)
|
||||||
else:
|
else:
|
||||||
common_networks = node_one.commonnets(node_two)
|
common_networks = node_one.commonnets(node_two)
|
||||||
|
|
|
@ -294,7 +294,6 @@ class CoreNodeBase(NodeBase):
|
||||||
if ifindex in self._netif:
|
if ifindex in self._netif:
|
||||||
raise ValueError(f"ifindex {ifindex} already exists")
|
raise ValueError(f"ifindex {ifindex} already exists")
|
||||||
self._netif[ifindex] = netif
|
self._netif[ifindex] = netif
|
||||||
# TODO: this should have probably been set ahead, seems bad to me, check for failure and fix
|
|
||||||
netif.netindex = ifindex
|
netif.netindex = ifindex
|
||||||
|
|
||||||
def delnetif(self, ifindex):
|
def delnetif(self, ifindex):
|
||||||
|
@ -310,13 +309,11 @@ class CoreNodeBase(NodeBase):
|
||||||
netif.shutdown()
|
netif.shutdown()
|
||||||
del netif
|
del netif
|
||||||
|
|
||||||
# TODO: net parameter is not used, remove
|
def netif(self, ifindex):
|
||||||
def netif(self, ifindex, net=None):
|
|
||||||
"""
|
"""
|
||||||
Retrieve network interface.
|
Retrieve network interface.
|
||||||
|
|
||||||
:param int ifindex: index of interface to retrieve
|
:param int ifindex: index of interface to retrieve
|
||||||
:param core.nodes.interface.CoreInterface net: network node
|
|
||||||
:return: network interface, or None if not found
|
:return: network interface, or None if not found
|
||||||
:rtype: core.nodes.interface.CoreInterface
|
:rtype: core.nodes.interface.CoreInterface
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -337,8 +337,6 @@ class CoreNetwork(CoreNetworkBase):
|
||||||
del self.session
|
del self.session
|
||||||
self.up = False
|
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):
|
def attach(self, netif):
|
||||||
"""
|
"""
|
||||||
Attach a network interface.
|
Attach a network interface.
|
||||||
|
@ -1064,7 +1062,7 @@ class WlanNode(CoreNetwork):
|
||||||
"""
|
"""
|
||||||
Attach a network interface.
|
Attach a network interface.
|
||||||
|
|
||||||
:param core.nodes.interface.CoreInterface netif: network interface
|
:param core.nodes.interface.Veth netif: network interface
|
||||||
:return: nothing
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
CoreNetwork.attach(self, netif)
|
CoreNetwork.attach(self, netif)
|
||||||
|
|
Loading…
Reference in a new issue