Update to ordering

- Prune bridgedomains before pruning BVIs. The reason for this is that
  prune_bridgedomains() will set the BVI to L3 mode, and if the BVI is
  removed before the bridge is pruned, this is an error.
- When pruning bridge members, use the VPP configuration as the member
  may not exist in the config, upon which the call to interface.is_sub()
  will return False even if it is actually a VPP sub-int.

Update README.md, also take into account the previous change which calls
prune_addresses() before object deletion.
This commit is contained in:
Pim van Pelt
2022-03-25 13:56:04 +00:00
parent a068f25f19
commit 152fa12099
2 changed files with 23 additions and 16 deletions

View File

@ -57,12 +57,12 @@ class Reconciler():
if not self.prune_loopbacks():
self.logger.warning("Could not prune loopbacks from VPP")
ret = False
if not self.prune_bvis():
self.logger.warning("Could not prune BVIs from VPP")
ret = False
if not self.prune_bridgedomains():
self.logger.warning("Could not prune BridgeDomains from VPP")
ret = False
if not self.prune_bvis():
self.logger.warning("Could not prune BVIs from VPP")
ret = False
if not self.prune_l2xcs():
self.logger.warning("Could not prune L2 Cross Connects from VPP")
ret = False
@ -70,13 +70,13 @@ class Reconciler():
self.logger.warning("Could not prune VXLAN Tunnels from VPP")
ret = False
if not self.prune_sub_interfaces():
self.logger.warning("Could not prune interfaces from VPP")
self.logger.warning("Could not prune sub-interfaces from VPP")
ret = False
if not self.prune_bondethernets():
self.logger.warning("Could not prune BondEthernets from VPP")
ret = False
if not self.prune_phys():
self.logger.warning("Could not prune interfaces from VPP")
self.logger.warning("Could not prune PHYs from VPP")
ret = False
return ret
@ -134,8 +134,9 @@ class Reconciler():
members = []
if not config_iface:
for member in bridge.sw_if_details:
member_ifname = self.vpp.config['interfaces'][member.sw_if_index].interface_name
if interface.is_sub(self.cfg, member_ifname):
member_iface = self.vpp.config['interfaces'][member.sw_if_index]
member_ifname = member_iface.interface_name
if member_iface.sub_id > 0:
self.logger.info("1> set interface l2 tag-rewrite %s disable" % member_ifname)
self.logger.info("1> set interface l3 %s" % member_ifname)
self.logger.info("1> create bridge-domain %d del" % idx)