SNAT implementation for DVR
[groupbasedpolicy.git] / neutron-mapper / src / main / java / org / opendaylight / groupbasedpolicy / neutron / mapper / mapping / NeutronFloatingIpAware.java
index b63aad634f5893908d76f9499cc526d29e670b9a..2c7b97af2690dab823e0c94d9c6c867e12e43600 100644 (file)
@@ -84,23 +84,14 @@ public class NeutronFloatingIpAware implements NeutronAware<Floatingip> {
         if (oldEpIp != null && oldFloatingIp.getRouterId() != null) {
             L3ContextId routerL3ContextId = new L3ContextId(oldFloatingIp.getRouterId().getValue());
             DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
-                IidFactory.l3EndpointIid(routerL3ContextId, oldEpIp).augmentation(NatAddress.class), rwTx);
+                    IidFactory.l3EndpointIid(routerL3ContextId, oldEpIp).augmentation(NatAddress.class), rwTx);
         }
         if (epNatIp != null && newEpIp != null && newFloatingIp.getRouterId() != null) {
             L3ContextId routerL3ContextId = new L3ContextId(newFloatingIp.getRouterId().getValue());
             NatAddress nat = new NatAddressBuilder().setNatAddress(epNatIp).build();
-            AddressEndpointKey aek =
-                new AddressEndpointKey(newEpIp.getIpv4Address().getValue() + "/32", IpPrefixType.class,
-                    routerL3ContextId, L3Context.class);
-            LOG.info("Adding NAT augmentation {} for base-endpoint {}", epNatIp, aek);
-            rwTx.put(LogicalDatastoreType.OPERATIONAL, IidFactory.addressEndpointIid(aek)
-                    .augmentation(
-                        org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.NatAddress.class),
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.NatAddressBuilder()
-                    .setNatAddress(epNatIp)
-                    .build(), true);
-            rwTx.put(LogicalDatastoreType.OPERATIONAL, IidFactory.l3EndpointIid(routerL3ContextId, newEpIp)
-                .augmentation(NatAddress.class), nat, true);
+            LOG.info("Adding NAT augmentation {} for endpoint (deperecated model) {}", epNatIp, newEpIp.getValue());
+            rwTx.put(LogicalDatastoreType.OPERATIONAL,
+                    IidFactory.l3EndpointIid(routerL3ContextId, newEpIp).augmentation(NatAddress.class), nat, true);
         }
     }