From 864c78ddfe5e7ffe0c54f1ab3a9d6b4774e7e336 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Fri, 25 Mar 2022 00:29:57 +0000 Subject: [PATCH] Only change link and MTU if they differ from the vpp_iface --- vpp/reconciler.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vpp/reconciler.py b/vpp/reconciler.py index e2488b9..bdb96be 100644 --- a/vpp/reconciler.py +++ b/vpp/reconciler.py @@ -206,10 +206,11 @@ class Reconciler(): if vpp_iface.sub_id > 0: self.logger.info("1> delete sub %s" % vpp_ifname) else: - self.logger.info("1> set interface state %s down" % vpp_ifname) - self.logger.info("1> set interface l3 %s" % vpp_ifname) + if vpp_iface.flags & 1: # IF_STATUS_API_FLAG_ADMIN_UP + self.logger.info("1> set interface state %s down" % vpp_ifname) self.prune_addresses(vpp_ifname, []) - self.logger.info("1> set interface mtu 9000 %s" % vpp_ifname) + if vpp_iface.link_mtu != 9000: + self.logger.info("1> set interface mtu 9000 %s" % vpp_ifname) continue addresses = [] if 'addresses' in config_iface: @@ -375,7 +376,9 @@ class Reconciler(): def prune_addresses_set_interface_down(self): for ifname in self.vpp.get_qinx_interfaces() + self.vpp.get_dot1x_interfaces() + self.vpp.get_bondethernets() + self.vpp.get_vxlan_tunnels() + self.vpp.get_phys(): if not ifname in interface.get_interfaces(self.cfg): - self.logger.info("1> set interface state %s down" % ifname) + iface = self.vpp.config['interface_names'][ifname] + if iface.flags & 1: # IF_STATUS_API_FLAG_ADMIN_UP + self.logger.info("1> set interface state %s down" % ifname) self.prune_addresses(ifname, []) return True