Fix GNPy functional tests issue due to Mg bump 68/87968/1
authorGilles Thouenon <gilles.thouenon@orange.com>
Fri, 28 Feb 2020 10:29:21 +0000 (11:29 +0100)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Fri, 28 Feb 2020 18:40:00 +0000 (18:40 +0000)
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Co-authored-by: Ahmed Triki <ahmed.triki.tn@gmail.com>
Change-Id: I418faab4b76899313c9d1ca86db4240704aaabd5
(cherry picked from commit 9bb27cb98374d76b579c97be3083524b5e94f9bd)

pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyServiceImpl.java

index 44ba0f543d84e9b23023c111007b036d0f475574..2bf8dfb6586bb7221b8681ac018b7d87bc06a0c5 100644 (file)
@@ -137,8 +137,11 @@ public class GnpyServiceImpl {
         ExplicitRouteObjects explicitRouteObjects = new ExplicitRouteObjectsBuilder()
             .setRouteObjectIncludeExclude(routeObjectIncludeExcludes).build();
         //Create Path Constraint
-        PathConstraints pathConstraints =
-            createPathConstraints(atoz.getRate().toJava(),atoz.getAToZWavelengthNumber().toJava());
+        Long atozWavelength = null;
+        if (atoz.getAToZWavelengthNumber() != null) {
+            atozWavelength = atoz.getAToZWavelengthNumber().toJava();
+        }
+        PathConstraints pathConstraints = createPathConstraints(atoz.getRate().toJava(), atozWavelength);
 
         // Create the path request
         List<PathRequest> pathRequestList = new ArrayList<>();
@@ -170,8 +173,11 @@ public class GnpyServiceImpl {
         ExplicitRouteObjects explicitRouteObjects = new ExplicitRouteObjectsBuilder()
             .setRouteObjectIncludeExclude(routeObjectIncludeExcludes).build();
         //Create Path Constraint
-        PathConstraints pathConstraints = createPathConstraints(ztoa.getRate().toJava(),
-            ztoa.getZToAWavelengthNumber().toJava());
+        Long ztoaWavelength = null;
+        if (ztoa.getZToAWavelengthNumber() != null) {
+            ztoaWavelength = ztoa.getZToAWavelengthNumber().toJava();
+        }
+        PathConstraints pathConstraints = createPathConstraints(ztoa.getRate().toJava(), ztoaWavelength);
 
         // Create the path request
         List<PathRequest> pathRequestList = new ArrayList<>();