From 7ed8ef179ce95a1f6b540acb34ef6c22879bc3ae Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 9 Oct 2021 19:11:42 -0400 Subject: [PATCH] Revert "Avoid duplicate runs of MTU validator" This reverts commit 56021c443a0a992e44350aa960976c6e8bddcb79. --- .../pvcnoded/objects/VXNetworkInstance.py | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/node-daemon/pvcnoded/objects/VXNetworkInstance.py b/node-daemon/pvcnoded/objects/VXNetworkInstance.py index 08bc37d9..58af404c 100644 --- a/node-daemon/pvcnoded/objects/VXNetworkInstance.py +++ b/node-daemon/pvcnoded/objects/VXNetworkInstance.py @@ -77,7 +77,13 @@ class VXNetworkInstance(object): def init_bridged(self): self.old_description = None self.description = None - self.vx_mtu = None + + try: + self.vx_mtu = self.zkhandler.read(('network.mtu', self.vni)) + except Exception: + self.vx_mtu = None + + self.validateNetworkMTU() # Zookeper handlers for changed states @self.zkhandler.zk_conn.DataWatch(self.zkhandler.schema.path('network', self.vni)) @@ -105,8 +111,7 @@ class VXNetworkInstance(object): self.validateNetworkMTU() self.updateNetworkMTU() except Exception: - self.validateNetworkMTU() - self.updateNetworkMTU() + pass self.createNetworkBridged() @@ -126,7 +131,13 @@ class VXNetworkInstance(object): self.dhcp4_flag = self.zkhandler.read(('network.ip4.dhcp', self.vni)) self.dhcp4_start = self.zkhandler.read(('network.ip4.dhcp_start', self.vni)) self.dhcp4_end = self.zkhandler.read(('network.ip4.dhcp_end', self.vni)) - self.vx_mtu = None + + try: + self.vx_mtu = self.zkhandler.read(('network.mtu', self.vni)) + except Exception: + self.vx_mtu = None + + self.validateNetworkMTU() self.nftables_netconf_filename = '{}/networks/{}.nft'.format(self.config['nft_dynamic_directory'], self.vni) self.firewall_rules = [] @@ -246,8 +257,7 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out self.validateNetworkMTU() self.updateNetworkMTU() except Exception: - self.validateNetworkMTU() - self.updateNetworkMTU() + pass @self.zkhandler.zk_conn.DataWatch(self.zkhandler.schema.path('network.ip6.network', self.vni)) def watch_network_ip6_network(data, stat, event=''):