From 30399608bc847e89700625fd4105f6b68087d65d Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 24 Sep 2018 02:16:02 -0400 Subject: [PATCH] Fix up router creation bug --- router-daemon/pvcrd/Daemon.py | 11 ++++------- router-daemon/pvcrd/RouterInstance.py | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/router-daemon/pvcrd/Daemon.py b/router-daemon/pvcrd/Daemon.py index 64de599f..075d8a9a 100644 --- a/router-daemon/pvcrd/Daemon.py +++ b/router-daemon/pvcrd/Daemon.py @@ -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))) diff --git a/router-daemon/pvcrd/RouterInstance.py b/router-daemon/pvcrd/RouterInstance.py index e1d2ccc1..7c9ea139 100644 --- a/router-daemon/pvcrd/RouterInstance.py +++ b/router-daemon/pvcrd/RouterInstance.py @@ -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):