diff options
author | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2020-04-29 15:38:24 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2020-04-30 12:19:26 +0000 |
commit | 9a2ca9be8c84fa1f78b32d3a9e2738b99c8826d2 (patch) | |
tree | dcb0de7e0bec3797d7073b7e8951ee37fd78007f /ms/blueprintsprocessor/functions | |
parent | 687b9ee9bf3dd169b2e032c0aa572e93b38306ca (diff) |
RestResourceResolutionProcessor should always set Status
Issue-ID: CCSDK-2350
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Change-Id: Ieadfb9b5931808f9eb298aa913d32cabbad67e2e
(cherry picked from commit f8b1afe40d6c741f91e9858e02338b231b8d608a)
Diffstat (limited to 'ms/blueprintsprocessor/functions')
-rw-r--r-- | ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt index 7596d7d8c..c60bc7648 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt @@ -24,6 +24,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPrope import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty @@ -103,6 +104,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS val responseBody = response.body val outputKeyMapping = sourceProperties.outputKeyMapping if (responseStatusCode in 200..299 && outputKeyMapping.isNullOrEmpty()) { + resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS logger.info("AS>> outputKeyMapping==null, will not populateResource") } else if (responseStatusCode in 200..299 && !responseBody.isBlank()) { populateResource(resourceAssignment, sourceProperties, responseBody, path) @@ -117,6 +119,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment) } catch (e: BluePrintProcessorException) { val errorMsg = "Failed to process REST resource resolution in template key ($resourceAssignment) assignments." + ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, errorMsg) throw e.updateErrorMessage(ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg, "Wrong resource definition or resolution failed.") } catch (e: Exception) { |