Fix bug where network list grows
This commit is contained in:
parent
0b5a492859
commit
4612c8086f
|
@ -249,10 +249,10 @@ def updatenetworks(new_network_list):
|
||||||
s_network[network].stopDHCPServer()
|
s_network[network].stopDHCPServer()
|
||||||
s_network[network].removeGatewayAddress()
|
s_network[network].removeGatewayAddress()
|
||||||
s_network[network].removeNetwork()
|
s_network[network].removeNetwork()
|
||||||
|
network_list = new_network_list
|
||||||
for router in router_list:
|
for router in router_list:
|
||||||
if router in t_router:
|
if router in t_router:
|
||||||
t_router[router].updatenetworklist(s_network)
|
t_router[router].updatenetworklist(s_network)
|
||||||
network_list = new_network_list
|
|
||||||
print(ansiiprint.blue() + 'Network list: ' + ansiiprint.end() + '{}'.format(' '.join(network_list)))
|
print(ansiiprint.blue() + 'Network list: ' + ansiiprint.end() + '{}'.format(' '.join(network_list)))
|
||||||
|
|
||||||
# Create timer to update this router in Zookeeper
|
# Create timer to update this router in Zookeeper
|
||||||
|
|
|
@ -126,8 +126,10 @@ class RouterInstance():
|
||||||
|
|
||||||
def updatenetworklist(self, s_network):
|
def updatenetworklist(self, s_network):
|
||||||
self.s_network = s_network
|
self.s_network = s_network
|
||||||
|
network_list = []
|
||||||
for network in s_network:
|
for network in s_network:
|
||||||
self.network_list.append(s_network[network].getvni())
|
network_list.append(s_network[network].getvni())
|
||||||
|
self.network_list = network_list
|
||||||
|
|
||||||
def become_secondary(self):
|
def become_secondary(self):
|
||||||
ansiiprint.echo('Setting router {} to secondary state'.format(self.name), '', 'i')
|
ansiiprint.echo('Setting router {} to secondary state'.format(self.name), '', 'i')
|
||||||
|
|
Loading…
Reference in New Issue