Prune sub-ints that have a different encap than their config counterpart
This commit is contained in:
@ -329,8 +329,8 @@ class Reconciler():
|
|||||||
return match
|
return match
|
||||||
|
|
||||||
def prune_sub_interfaces(self):
|
def prune_sub_interfaces(self):
|
||||||
""" Remove interfaces from VPP if they are not in the config. Start with inner-most (QinQ/QinAD), then
|
""" Remove interfaces from VPP if they are not in the config, or if their encapsulation is different.
|
||||||
Dot1Q/Dot1AD."""
|
Start with inner-most (QinQ/QinAD), then Dot1Q/Dot1AD."""
|
||||||
removed_interfaces=[]
|
removed_interfaces=[]
|
||||||
for numtags in [ 2, 1 ]:
|
for numtags in [ 2, 1 ]:
|
||||||
for vpp_ifname in self.vpp.get_sub_interfaces():
|
for vpp_ifname in self.vpp.get_sub_interfaces():
|
||||||
@ -347,6 +347,13 @@ class Reconciler():
|
|||||||
self.logger.info("1> delete sub %s" % vpp_ifname)
|
self.logger.info("1> delete sub %s" % vpp_ifname)
|
||||||
removed_interfaces.append(vpp_ifname)
|
removed_interfaces.append(vpp_ifname)
|
||||||
continue
|
continue
|
||||||
|
config_encap = interface.get_encapsulation(self.cfg, vpp_ifname)
|
||||||
|
vpp_encap = self.__get_encapsulation(vpp_iface)
|
||||||
|
if config_encap != vpp_encap:
|
||||||
|
self.prune_addresses(vpp_ifname, [])
|
||||||
|
self.logger.info("2> delete sub %s" % vpp_ifname)
|
||||||
|
removed_interfaces.append(vpp_ifname)
|
||||||
|
continue
|
||||||
addresses = []
|
addresses = []
|
||||||
if 'addresses' in config_iface:
|
if 'addresses' in config_iface:
|
||||||
addresses = config_iface['addresses']
|
addresses = config_iface['addresses']
|
||||||
|
Reference in New Issue
Block a user