updated interface.py to use python3 super()
This commit is contained in:
parent
b185c3c679
commit
440c8ed565
4 changed files with 7 additions and 7 deletions
|
@ -302,7 +302,7 @@ class BasicRangeModel(WirelessModel):
|
||||||
:param core.session.Session session: related core session
|
:param core.session.Session session: related core session
|
||||||
:param int _id: object id
|
:param int _id: object id
|
||||||
"""
|
"""
|
||||||
super().__init__(session=session, _id=_id)
|
super().__init__(session, _id)
|
||||||
self.session = session
|
self.session = session
|
||||||
self.wlan = session.get_node(_id)
|
self.wlan = session.get_node(_id)
|
||||||
self._netifs = {}
|
self._netifs = {}
|
||||||
|
|
|
@ -232,7 +232,7 @@ class Veth(CoreInterface):
|
||||||
:raises CoreCommandError: when there is a command exception
|
:raises CoreCommandError: when there is a command exception
|
||||||
"""
|
"""
|
||||||
# note that net arg is ignored
|
# note that net arg is ignored
|
||||||
CoreInterface.__init__(self, session, node, name, mtu, server)
|
super().__init__(session, node, name, mtu, server)
|
||||||
self.localname = localname
|
self.localname = localname
|
||||||
self.up = False
|
self.up = False
|
||||||
if start:
|
if start:
|
||||||
|
@ -293,7 +293,7 @@ class TunTap(CoreInterface):
|
||||||
will run on, default is None for localhost
|
will run on, default is None for localhost
|
||||||
:param bool start: start flag
|
:param bool start: start flag
|
||||||
"""
|
"""
|
||||||
CoreInterface.__init__(self, session, node, name, mtu, server)
|
super().__init__(session, node, name, mtu, server)
|
||||||
self.localname = localname
|
self.localname = localname
|
||||||
self.up = False
|
self.up = False
|
||||||
self.transport_type = "virtual"
|
self.transport_type = "virtual"
|
||||||
|
@ -476,7 +476,7 @@ class GreTap(CoreInterface):
|
||||||
will run on, default is None for localhost
|
will run on, default is None for localhost
|
||||||
:raises CoreCommandError: when there is a command exception
|
:raises CoreCommandError: when there is a command exception
|
||||||
"""
|
"""
|
||||||
CoreInterface.__init__(self, session, node, name, mtu, server)
|
super().__init__(session, node, name, mtu, server)
|
||||||
if _id is None:
|
if _id is None:
|
||||||
# from PyCoreObj
|
# from PyCoreObj
|
||||||
_id = ((id(self) >> 16) ^ (id(self) & 0xFFFF)) & 0xFFFF
|
_id = ((id(self) >> 16) ^ (id(self) & 0xFFFF)) & 0xFFFF
|
||||||
|
|
|
@ -401,7 +401,7 @@ class Ipv4Prefix(IpPrefix):
|
||||||
|
|
||||||
:param str prefixstr: ip prefix
|
:param str prefixstr: ip prefix
|
||||||
"""
|
"""
|
||||||
IpPrefix.__init__(self, AF_INET, prefixstr)
|
super().__init__(AF_INET, prefixstr)
|
||||||
|
|
||||||
|
|
||||||
class Ipv6Prefix(IpPrefix):
|
class Ipv6Prefix(IpPrefix):
|
||||||
|
@ -415,7 +415,7 @@ class Ipv6Prefix(IpPrefix):
|
||||||
|
|
||||||
:param str prefixstr: ip prefix
|
:param str prefixstr: ip prefix
|
||||||
"""
|
"""
|
||||||
IpPrefix.__init__(self, AF_INET6, prefixstr)
|
super().__init__(AF_INET6, prefixstr)
|
||||||
|
|
||||||
|
|
||||||
def is_ip_address(af, addrstr):
|
def is_ip_address(af, addrstr):
|
||||||
|
|
|
@ -19,7 +19,7 @@ class PhysicalNode(CoreNodeBase):
|
||||||
def __init__(
|
def __init__(
|
||||||
self, session, _id=None, name=None, nodedir=None, start=True, server=None
|
self, session, _id=None, name=None, nodedir=None, start=True, server=None
|
||||||
):
|
):
|
||||||
CoreNodeBase.__init__(self, session, _id, name, start, server)
|
super().__init__(session, _id, name, start, server)
|
||||||
if not self.server:
|
if not self.server:
|
||||||
raise CoreError("physical nodes must be assigned to a remote server")
|
raise CoreError("physical nodes must be assigned to a remote server")
|
||||||
self.nodedir = nodedir
|
self.nodedir = nodedir
|
||||||
|
|
Loading…
Add table
Reference in a new issue