this.updateL3ForNeutronPort(neutronPort, currPortShouldBeDeleted);
}
- if (isDelete) {
- /*
- * Bug 4277: Remove the router interface cache only after deleting the neutron port l3 flows.
- */
- this.cleanupRouterCache(neutronRouterInterface);
- }
}
/**
final String networkUUID = neutronPort.getNetworkUUID();
final String routerMacAddress = networkIdToRouterMacCache.get(networkUUID);
- // If there is no router interface handling the networkUUID, we are done
- if (routerMacAddress == null || routerMacAddress.isEmpty()) {
- return;
- }
+ if(!isDelete) {
+ // If there is no router interface handling the networkUUID, we are done
+ if (routerMacAddress == null || routerMacAddress.isEmpty()) {
+ return;
+ }
- // If this is the neutron port for the router interface itself, ignore it as well. Ports that represent the
- // router interface are handled via handleNeutronRouterInterfaceEvent.
- if (routerMacAddress.equalsIgnoreCase(neutronPort.getMacAddress())) {
- return;
+ // If this is the neutron port for the router interface itself, ignore it as well. Ports that represent the
+ // router interface are handled via handleNeutronRouterInterfaceEvent.
+ if (routerMacAddress.equalsIgnoreCase(neutronPort.getMacAddress())) {
+ return;
+ }
}
final NeutronNetwork neutronNetwork = neutronNetworkCache.getNetwork(networkUUID);
}
}
- // Keep cache for finding router's mac from network uuid -- NOTE: remove is done later, via cleanupRouterCache()
+ if (isDelete) {
+ networkIdToRouterMacCache.remove(neutronNetwork.getNetworkUUID());
+ networkIdToRouterIpListCache.remove(neutronNetwork.getNetworkUUID());
+ subnetIdToRouterInterfaceCache.remove(subnet.getSubnetUUID());
+ }
}
private void programFlowForNetworkFromExternal(final Node node,
return null;
}
- private void cleanupRouterCache(final NeutronRouter_Interface neutronRouterInterface) {
- /*
- * Fix for 4277
- * Remove the router cache only after deleting the neutron
- * port l3 flows.
- */
- final NeutronPort neutronPort = neutronPortCache.getPort(neutronRouterInterface.getPortUUID());
-
- if (neutronPort != null) {
- networkIdToRouterMacCache.remove(neutronPort.getNetworkUUID());
- networkIdToRouterIpListCache.remove(neutronPort.getNetworkUUID());
- subnetIdToRouterInterfaceCache.remove(neutronRouterInterface.getSubnetUUID());
- }
- }
-
private void cleanupFloatingIPRules(final NeutronPort neutronPort) {
List<NeutronFloatingIP> neutronFloatingIps = neutronFloatingIpCache.getAllFloatingIPs();
}
public void removePortFromCleanupCache(NeutronPort port) {
- this.portCleanupCache.remove(port.getPortUUID());
+ if(port != null) {
+ this.portCleanupCache.remove(port.getPortUUID());
+ }
}
public Map<String, NeutronPort> getPortCleanupCache() {