public static final String DEVICE_OWNER_GATEWAY_INF = "network:router_gateway";
public static final String DEVICE_OWNER_ROUTER_INF = "network:router_interface";
public static final String DEVICE_OWNER_FLOATING_IP = "network:floatingip";
+ public static final String FLOATING_IP_DEVICE_ID_PENDING = "PENDING";
public static final String PREFIX_TAP = "tap";
public static final String PREFIX_VHOSTUSER = "vhu";
public static final String RD_IDPOOL_NAME = "RouteDistinguisherPool";
if (NeutronConstants.DEVICE_OWNER_GATEWAY_INF.equals(input.getDeviceOwner())) {
handleRouterGatewayUpdated(input);
} else if (NeutronConstants.DEVICE_OWNER_FLOATING_IP.equals(input.getDeviceOwner())) {
-
- // populate floating-ip uuid and floating-ip port attributes (uuid, mac and subnet id for the ONLY
- // fixed IP) to be used by NAT, depopulated in NATService once mac is retrieved in the removal path
- addToFloatingIpPortInfo(new Uuid(input.getDeviceId()), input.getUuid(), input.getFixedIps().get(0)
- .getSubnetId(), input.getMacAddress().getValue());
-
- elanService.handleKnownL3DmacAddress(input.getMacAddress().getValue(), input.getNetworkId().getValue(),
- NwConstants.ADD_FLOW);
+ handleFloatingIpPortUpdated(null, input);
}
}
if (input.getFixedIps() != null && !input.getFixedIps().isEmpty()) {
if (NeutronConstants.DEVICE_OWNER_GATEWAY_INF.equals(update.getDeviceOwner())) {
handleRouterGatewayUpdated(update);
} else if (NeutronConstants.DEVICE_OWNER_FLOATING_IP.equals(update.getDeviceOwner())) {
+ handleFloatingIpPortUpdated(original, update);
+ }
+ }
+
+ private void handleFloatingIpPortUpdated(Port original, Port update) {
+ if (((original == null) || (original.getDeviceId().equals(NeutronConstants.FLOATING_IP_DEVICE_ID_PENDING)))
+ && !update.getDeviceId().equals(NeutronConstants.FLOATING_IP_DEVICE_ID_PENDING)) {
+ // populate floating-ip uuid and floating-ip port attributes (uuid, mac and subnet id for the ONLY
+ // fixed IP) to be used by NAT, depopulated in NATService once mac is retrieved in the removal path
+ addToFloatingIpPortInfo(new Uuid(update.getDeviceId()), update.getUuid(), update.getFixedIps().get(0)
+ .getSubnetId(), update.getMacAddress().getValue());
elanService.handleKnownL3DmacAddress(update.getMacAddress().getValue(), update.getNetworkId().getValue(),
NwConstants.ADD_FLOW);
}