Merge changes If4c7fd58,Ib8275ddc
authorGuillaume Lambert <guillaume.lambert@orange.com>
Mon, 7 Feb 2022 08:35:18 +0000 (08:35 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 7 Feb 2022 08:35:18 +0000 (08:35 +0000)
* changes:
  Refactor PCE network analyzer PceOtnNode step 1
  Refactor networkmodel util OpenRoadmOtnTopology

common/src/main/java/org/opendaylight/transportpce/common/fixedflex/GridConstant.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/MappingUtilsImpl.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion221.java
tox.ini

index 7282bec3cc5c42678c2533a6a1d68853a4883cd1..efb8fb7172062f8335bf13a619a8ab0afaf5fac7 100644 (file)
@@ -98,8 +98,8 @@ public final class GridConstant {
     private static Table<Uint32, ModulationFormat, String> initFrequencyWidthTable() {
         Table<Uint32, ModulationFormat, String> frequencyWidthTable = HashBasedTable.create();
         frequencyWidthTable.put(ServiceRateConstant.RATE_100, ModulationFormat.DpQpsk, String.valueOf(WIDTH_40));
-        frequencyWidthTable.put(ServiceRateConstant.RATE_200, ModulationFormat.DpQpsk, String.valueOf(WIDTH_80));
-        frequencyWidthTable.put(ServiceRateConstant.RATE_300, ModulationFormat.DpQam8, String.valueOf(WIDTH_80));
+        frequencyWidthTable.put(ServiceRateConstant.RATE_200, ModulationFormat.DpQpsk, String.valueOf(WIDTH_75));
+        frequencyWidthTable.put(ServiceRateConstant.RATE_300, ModulationFormat.DpQam8, String.valueOf(WIDTH_75));
         frequencyWidthTable.put(ServiceRateConstant.RATE_400, ModulationFormat.DpQam16, String.valueOf(WIDTH_75));
         return frequencyWidthTable;
     }
index 6f3608710e9183a85f41f1565a274b477ebe7213..d3b6df0ffdb7ab5afa895e0b232431fce54e03ff 100644 (file)
@@ -31,6 +31,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.If1G
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.If1GEODU0;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.If400GE;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.IfOCH;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.IfOCHOTU2EODU2E;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.IfOCHOTU2ODU2;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.IfOCHOTU4ODU4;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.IfOTUCnODUCn;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.SupportedIfCapability;
@@ -57,6 +59,8 @@ public class MappingUtilsImpl implements MappingUtils {
             put("If100GE", If100GE.class);
             put("If10GE", If10GE.class);
             put("If1GE", If1GE.class);
+            put("IfOCHOTU2EODU2E", IfOCHOTU2EODU2E.class);
+            put("IfOCHOTU2ODU2", IfOCHOTU2ODU2.class);
         }
     };
 
index 73801e7b96120db5ec9e47740908f7735320d383..75cdf8d48a2c5b82e435426d14283a3f507a15ad 100644 (file)
@@ -690,7 +690,6 @@ public class PortMappingVersion221 {
         nodesList.put(nodes.key(),nodes);
 
         Network network = new NetworkBuilder().setNodes(nodesList).build();
-
         final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
         InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
         writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, network);
@@ -869,7 +868,9 @@ public class PortMappingVersion221 {
             List<Class<? extends org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327
                 .SupportedIfCapability>> supportedIntf = new ArrayList<>();
             for (Class<? extends SupportedIfCapability> sup: port.getSupportedInterfaceCapability()) {
-                supportedIntf.add(MappingUtilsImpl.convertSupIfCapa(sup.getSimpleName()));
+                if (MappingUtilsImpl.convertSupIfCapa(sup.getSimpleName()) != null) {
+                    supportedIntf.add(MappingUtilsImpl.convertSupIfCapa(sup.getSimpleName()));
+                }
             }
             mpBldr.setSupportedInterfaceCapability(supportedIntf);
         }
diff --git a/tox.ini b/tox.ini
index db710a348e18b210964f646975500be76cf99fc7..059b847c7d26cd91c9f39bdcf7e446850cb19a33 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -64,7 +64,7 @@ deps =
   -r{toxinidir}/tests/requirements.txt
   -r{toxinidir}/tests/test-requirements.txt
   setuptools>=7.0
-  gnpy4tpce
+  gnpy4tpce==1.2.1
 whitelist_externals = launch_tests.sh
 passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
 #setenv =
@@ -298,5 +298,5 @@ commands =
 basepython = python3
 deps = gitlint
 commands =
-    gitlint
+    gitlint --config ../.gitlint