Fix up router creation bug

This commit is contained in:
Joshua Boniface 2018-09-24 02:16:02 -04:00
parent e6949ff126
commit 30399608bc
2 changed files with 5 additions and 8 deletions

View File

@ -213,18 +213,15 @@ def updaterouters(new_router_list):
@zk_conn.ChildrenWatch('/networks')
def updatenetworks(new_network_list):
global network_list
for network in network_list:
for network in new_network_list:
if not network in s_network:
s_network[network] = VXNetworkInstance.VXNetworkInstance(network, zk_conn, config, t_router[myhostname]);
for router in router_list:
if router in t_router:
t_router[router].updatenetworklist(s_network)
if not network in new_network_list:
s_network[network].removeAddress()
s_network[network].removeNetwork()
for router in router_list:
if router in t_router:
t_router[router].updatenetworklist(s_network)
for router in router_list:
if router in t_router:
t_router[router].updatenetworklist(s_network)
network_list = new_network_list
print(ansiiprint.blue() + 'Network list: ' + ansiiprint.end() + '{}'.format(' '.join(network_list)))

View File

@ -98,7 +98,7 @@ class RouterInstance():
def updatenetworklist(self, s_network):
self.s_network = s_network
for network in s_network:
self.network_list.append(network.getvni())
self.network_list.append(s_network[network].getvni())
# Flush all VMs on the host
def set_secondary(self):