initial refactor for all variables named objid
This commit is contained in:
parent
f283c747cc
commit
9517740704
46 changed files with 346 additions and 353 deletions
|
@ -366,7 +366,7 @@ class EmuSession(Session):
|
|||
interface_one.detachnet()
|
||||
interface_two.detachnet()
|
||||
if net_one.numnetif() == 0:
|
||||
self.delete_object(net_one.objid)
|
||||
self.delete_object(net_one.id)
|
||||
node_one.delnetif(interface_one.netindex)
|
||||
node_two.delnetif(interface_two.netindex)
|
||||
finally:
|
||||
|
@ -493,7 +493,7 @@ class EmuSession(Session):
|
|||
|
||||
# create node
|
||||
logging.info("creating node(%s) id(%s) name(%s) start(%s)", node_class.__name__, _id, name, start)
|
||||
node = self.add_object(cls=node_class, objid=_id, name=name, start=start)
|
||||
node = self.add_object(cls=node_class, _id=_id, name=name, start=start)
|
||||
|
||||
# set node attributes
|
||||
node.icon = node_options.icon
|
||||
|
@ -599,7 +599,7 @@ class EmuSession(Session):
|
|||
"""
|
||||
node_data = NodeData(
|
||||
message_type=0,
|
||||
id=node.objid,
|
||||
id=node.id,
|
||||
x_position=node.position.x,
|
||||
y_position=node.position.y
|
||||
)
|
||||
|
|
|
@ -117,7 +117,7 @@ class IpPrefixes(object):
|
|||
"""
|
||||
if not self.ip4:
|
||||
raise ValueError("ip4 prefixes have not been set")
|
||||
return str(self.ip4.addr(node.objid))
|
||||
return str(self.ip4.addr(node.id))
|
||||
|
||||
def ip6_address(self, node):
|
||||
"""
|
||||
|
@ -129,7 +129,7 @@ class IpPrefixes(object):
|
|||
"""
|
||||
if not self.ip6:
|
||||
raise ValueError("ip6 prefixes have not been set")
|
||||
return str(self.ip6.addr(node.objid))
|
||||
return str(self.ip6.addr(node.id))
|
||||
|
||||
def create_interface(self, node, name=None, mac=None):
|
||||
"""
|
||||
|
@ -149,14 +149,14 @@ class IpPrefixes(object):
|
|||
ip4 = None
|
||||
ip4_mask = None
|
||||
if self.ip4:
|
||||
ip4 = str(self.ip4.addr(node.objid))
|
||||
ip4 = str(self.ip4.addr(node.id))
|
||||
ip4_mask = self.ip4.prefixlen
|
||||
|
||||
# generate ip6 data
|
||||
ip6 = None
|
||||
ip6_mask = None
|
||||
if self.ip6:
|
||||
ip6 = str(self.ip6.addr(node.objid))
|
||||
ip6 = str(self.ip6.addr(node.id))
|
||||
ip6_mask = self.ip6.prefixlen
|
||||
|
||||
# random mac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue