From 9b9db2f18c1fc16361154a55328304b6ffa9c49a Mon Sep 17 00:00:00 2001 From: Abdelmuhaimen Seaudi Date: Wed, 10 Jul 2019 20:47:26 +0000 Subject: Handle blank reponse body for PUT capability Issue-Id: CCSDK-1467 Signed-off-by: Abdelmuhaimen Seaudi Change-Id: Ibc50be0bf9986c49d2c7546f895c85c6851447bb --- .../resolution/processor/RestResourceResolutionProcessor.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin') 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 6cf1c0be7..3bf0b359a 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 @@ -88,7 +88,11 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS val response = restClientService.exchangeResource(verb, urlPath, payload) val responseStatusCode = response.status val responseBody = response.body - if (responseStatusCode in 200..299 && !responseBody.isBlank()) { + val outputKeyMapping = sourceProperties.outputKeyMapping + if (responseStatusCode in 200..299 && outputKeyMapping.isNullOrEmpty()) { + logger.info("AS>> outputKeyMapping==null, will not populateResource") + } + else if (responseStatusCode in 200..299 && !responseBody.isBlank()) { populateResource(resourceAssignment, sourceProperties, responseBody, path) } else { val errMsg = -- cgit 1.2.3-korg