Portmapping for SRGs with multiple circuit packs 29/99629/1
authorJonas Mårtensson <jonas.martensson@ri.se>
Tue, 1 Feb 2022 17:44:53 +0000 (18:44 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Mon, 7 Feb 2022 10:18:49 +0000 (11:18 +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 75cdf8d48a2c5b82e435426d14283a3f507a15ad..3c0f3a9f0c648f332a27bb824f1549691be98b30 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;