Bug in updating 7.1 port-mapping data
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / mapping / PortMappingVersion710.java
index c6fc82c0e46aaf1b6110b7b156a448b38ca8c43b..d1697fd21228595bf01341cd873fb8e972b0072f 100644 (file)
@@ -507,12 +507,12 @@ public class PortMappingVersion710 {
         for (Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.srg.CircuitPacks>>
                 srgCpEntry : getSrgCps(nodeId, deviceInfo).entrySet()) {
             List<String> keys = new ArrayList<>();
+            int portIndex = 1;
             for (org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.srg.CircuitPacks
                     cp : srgCpEntry.getValue()) {
                 String circuitPackName = cp.getCircuitPackName();
                 List<Ports> portList = getPortList(circuitPackName, nodeId);
                 Collections.sort(portList, new SortPort710ByName());
-                int portIndex = 1;
                 for (Ports port : portList) {
                     if (!checkPortQual(port, circuitPackName, nodeId)) {
                         continue;
@@ -942,7 +942,9 @@ public class PortMappingVersion710 {
 
     private MappingBuilder updateMappingInterfaces(String nodeId, MappingBuilder mpBldr, Ports port) {
         mpBldr.setSupportingOtu4(null)
-            .setSupportingOdu4(null);
+            .setSupportingOdu4(null)
+            .setSupportingOducn(null)
+            .setSupportingOtucn(null);
         for (Interfaces interfaces : port.getInterfaces()) {
             Optional<Interface> openRoadmInterface = getInterfaceFromDevice(nodeId,
                 interfaces.getInterfaceName());
@@ -965,7 +967,7 @@ public class PortMappingVersion710 {
             String interfaceName = interfaces.getInterfaceName();
             if (interfaceType.equals(OtnOtu.class)
                 && (interfaceName.substring(interfaceName.lastIndexOf("-") + 1)
-                .equals("OTU"))) {
+                .equals("OTU4"))) {
                 mpBldr.setSupportingOtu4(interfaces.getInterfaceName());
             }
             if ((interfaceType.equals(OtnOtu.class))
@@ -975,7 +977,7 @@ public class PortMappingVersion710 {
             }
             if (interfaceType.equals(OtnOdu.class)
                 && (interfaceName.substring(interfaceName.lastIndexOf("-") + 1)
-                .equals("ODU"))) {
+                .equals("ODU4"))) {
                 mpBldr.setSupportingOdu4(interfaces.getInterfaceName());
             }
             if ((interfaceType.equals(OtnOdu.class))