daemon: Use a set to store broker physical nodes.
This commit is contained in:
parent
4662164ece
commit
6494605298
1 changed files with 4 additions and 5 deletions
|
@ -51,8 +51,8 @@ class CoreBroker(ConfigurableManager):
|
||||||
self.bootcount = 0
|
self.bootcount = 0
|
||||||
# set of node numbers that are link-layer nodes (networks)
|
# set of node numbers that are link-layer nodes (networks)
|
||||||
self.nets = set()
|
self.nets = set()
|
||||||
# list of node numbers that are PhysicalNode nodes
|
# set of node numbers that are PhysicalNode nodes
|
||||||
self.phys = []
|
self.phys = set()
|
||||||
# allows for other message handlers to process API messages (e.g. EMANE)
|
# allows for other message handlers to process API messages (e.g. EMANE)
|
||||||
self.handlers = set()
|
self.handlers = set()
|
||||||
# dict with tunnel key to tunnel device mapping
|
# dict with tunnel key to tunnel device mapping
|
||||||
|
@ -99,7 +99,7 @@ class CoreBroker(ConfigurableManager):
|
||||||
self.bootcount = 0
|
self.bootcount = 0
|
||||||
self.nodemap_lock.release()
|
self.nodemap_lock.release()
|
||||||
self.nets.clear()
|
self.nets.clear()
|
||||||
del self.phys[:]
|
self.phys.clear()
|
||||||
while len(self.tunnels) > 0:
|
while len(self.tunnels) > 0:
|
||||||
(key, gt) = self.tunnels.popitem()
|
(key, gt) = self.tunnels.popitem()
|
||||||
gt.shutdown()
|
gt.shutdown()
|
||||||
|
@ -468,8 +468,7 @@ class CoreBroker(ConfigurableManager):
|
||||||
def addphys(self, nodenum):
|
def addphys(self, nodenum):
|
||||||
''' Add a node number to the list of physical nodes.
|
''' Add a node number to the list of physical nodes.
|
||||||
'''
|
'''
|
||||||
if nodenum not in self.phys:
|
self.phys.add(nodenum)
|
||||||
self.phys.append(nodenum)
|
|
||||||
|
|
||||||
def configure_reset(self, msg):
|
def configure_reset(self, msg):
|
||||||
''' Ignore reset messages, because node delete responses may still
|
''' Ignore reset messages, because node delete responses may still
|
||||||
|
|
Loading…
Reference in a new issue