Portmapping for SRGs with multiple circuit packs 51/99551/3
authorJonas Mårtensson <jonas.martensson@ri.se>
Tue, 1 Feb 2022 17:44:53 +0000 (18:44 +0100)
committerJonas Mårtensson <jonas.martensson@ri.se>
Thu, 3 Feb 2022 13:40:05 +0000 (14:40 +0100)
The createPpPortMapping function was resetting the logical connection
port index to 1 for every new circuit pack in an SRG so that multiple
physical ports (cp-name/port-name) were mapped to the same logical PP
port.

Move "int portIndex = 1;" to before the loop over cicuit packs.

JIRA: TRNSPRTPCE-598
Signed-off-by: Jonas Mårtensson <jonas.martensson@ri.se>
Change-Id: Ifaf4353d3eca0ee76f7e46cc81084ff5110b85f3

common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion121.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion221.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion710.java

index 7d605c717bacc3907893d2abcd6e8eb8bfa8aaf3..f2ec53a68924a07f25213481eebc35c58dd20920 100644 (file)
@@ -295,12 +295,12 @@ public class PortMappingVersion121 {
         for (Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.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.rev170206.srg.CircuitPacks
                     cp : srgCpEntry.getValue()) {
                 String circuitPackName = cp.getCircuitPackName();
                 List<Ports> portList = getPortList(circuitPackName, nodeId);
                 Collections.sort(portList, new SortPort121ByName());
-                int portIndex = 1;
                 for (Ports port : portList) {
                     if (!checkPortQual(port, circuitPackName, nodeId)) {
                         continue;
index 73801e7b96120db5ec9e47740908f7735320d383..58ea3e154365a7d4845570355915b62704962edc 100644 (file)
@@ -422,12 +422,12 @@ public class PortMappingVersion221 {
         for (Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.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.rev181019.srg.CircuitPacks
                     cp : srgCpEntry.getValue()) {
                 String circuitPackName = cp.getCircuitPackName();
                 List<Ports> portList = getPortList(circuitPackName, nodeId);
                 Collections.sort(portList, new SortPort221ByName());
-                int portIndex = 1;
                 for (Ports port : portList) {
                     if (!checkPortQual(port, circuitPackName, nodeId)) {
                         continue;
index e3809e81cefeeb3ad7bff46f80aac514afa6c981..01e97c7a5e5ef5da9c481232dbbc28b92ad555df 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;