fix two issues in ServiceHandlerImpl 41/83241/1
authorAhmed Abbas <ahmad.helmy@orange.com>
Wed, 24 Jul 2019 17:19:27 +0000 (19:19 +0200)
committerAhmed Abbas <ahmad.helmy@orange.com>
Wed, 24 Jul 2019 17:19:27 +0000 (19:19 +0200)
- remove duplicate call to performPCE
- return false on NullPointerException in validate service creation

Change-Id: Ia87f913009f20a0e85b91cef709f555ade72b5a7
Signed-off-by: Ahmed Abbas <ahmad.helmy@orange.com>
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/validation/ServiceCreateValidation.java

index e7ea1741a8682cdefdf98769b4776f5d1511805e..791af2a838084bac50206689ac90cd020df19d2a 100644 (file)
@@ -514,7 +514,6 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
         this.rendererListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations);
         this.rendererListenerImpl.setServiceInput(new ServiceInput(input));
         this.rendererListenerImpl.setTempService(true);
-        this.pceServiceWrapper.performPCE(input, true);
         PathComputationRequestOutput output = this.pceServiceWrapper.performPCE(input, true);
         if (output != null) {
             LOG.info("Service compliant, temp serviceCreate in progress...");
index 7b3e9cf1a15a629b43a9e2e511632035cc2f724e..aed25556241659efa7cf1c2ba7f8ee39c572bd09 100644 (file)
@@ -85,7 +85,7 @@ public final class ServiceCreateValidation {
             }
         } catch (NullPointerException e) {
             LOG.error("one of input parameter is null ",e);
-            OperationResult.failed("one of input parameter is null.");
+            return OperationResult.failed("one of input parameter is null.");
         }
         return OperationResult.ok("Validation successful.");
     }