diff options
author | Denes Nemeth <denes.nemeth@nokia.com> | 2018-03-14 09:51:50 +0100 |
---|---|---|
committer | Denes Nemeth <denes.nemeth@nokia.com> | 2018-03-14 14:53:54 +0100 |
commit | 876a4acf6f2e8264bb82e960e9aa886799c4bdb1 (patch) | |
tree | e929d22a832b73a2345b8c8f7f8c4a06721e4731 /nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java | |
parent | 626ebae46807adeab6d0b9d5568515f457c7ece3 (diff) |
Fix some security vulnerabilities
Change-Id: Ib1c08c4f73df8cfe42b2857ee674f102ec09c253
Signed-off-by: Denes Nemeth <denes.nemeth@nokia.com>
Issue-ID: VFC-728
Diffstat (limited to 'nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java')
-rw-r--r-- | nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java index 94cb404c..085231f6 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java @@ -19,7 +19,6 @@ import com.google.common.collect.Ordering; import com.google.common.collect.Sets; import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.nokia.cbam.lcm.v32.ApiException; import com.nokia.cbam.lcm.v32.api.OperationExecutionsApi; import com.nokia.cbam.lcm.v32.api.VnfsApi; import com.nokia.cbam.lcm.v32.model.OperationExecution; @@ -285,12 +284,13 @@ public class JobManager { } private boolean isCurrentOperationTriggeredByJob(String jobId, OperationExecutionsApi cbamOperationExecutionApi, OperationExecution operationExecution) { + try { - Object operationParams = cbamOperationExecutionApi.operationExecutionsOperationExecutionIdOperationParamsGet(operationExecution.getId(), NOKIA_LCM_API_VERSION); + Object operationParams = cbamOperationExecutionApi.operationExecutionsOperationExecutionIdOperationParamsGet(operationExecution.getId(), NOKIA_LCM_API_VERSION).blockingFirst(); if (extractOnapJobId(operationParams).equals(jobId)) { return true; } - } catch (ApiException e) { + } catch (Exception e) { throw buildFatalFailure(logger, "Unable to retrieve operation parameters", e); } return false; @@ -301,7 +301,7 @@ public class JobManager { //test if the VNF exists (required to be able to distingush between failed request ) VnfsApi cbamLcmApi = cbamRestApiProvider.getCbamLcmApi(vnfmId); logger.debug("Listing VNFs"); - List<VnfInfo> vnfs = cbamLcmApi.vnfsGet(NOKIA_LCM_API_VERSION); + List<VnfInfo> vnfs = cbamLcmApi.vnfsGet(NOKIA_LCM_API_VERSION).blockingSingle(); com.google.common.base.Optional<VnfInfo> vnf = tryFind(vnfs, vnfInfo -> vnfId.equals(vnfInfo.getId())); if (!vnf.isPresent()) { logger.debug("VNF with {} identifier is missing", vnfId); @@ -309,9 +309,9 @@ public class JobManager { } else { logger.debug("VNF with {} identifier still exists", vnfId); //query the VNF again to get operation execution result - return of(cbamLcmApi.vnfsVnfInstanceIdGet(vnfId, NOKIA_LCM_API_VERSION)); + return of(cbamLcmApi.vnfsVnfInstanceIdGet(vnfId, NOKIA_LCM_API_VERSION).blockingFirst()); } - } catch (ApiException e) { + } catch (Exception e) { throw buildFatalFailure(logger, "Unable to retrieve VNF", e); } } |