From: kuldipr Date: Wed, 9 Dec 2020 00:30:52 +0000 (-0500) Subject: ResourceResolution should fail if required resource did not resolve -edge case X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F68%2F116468%2F1;p=ccsdk%2Fcds.git ResourceResolution should fail if required resource did not resolve -edge case Issue-ID: CCSDK-3022 Signed-off-by: kuldipr Change-Id: Ia88a86f13c693a7bcd2d61cdfb5c2e39041b5a31 Signed-off-by: kuldipr --- diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt index 3b0eda01e..f9dfd864d 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt @@ -150,8 +150,11 @@ open class ResourceResolutionServiceImpl( val failedResolution = resourceAssignmentList.filter { it.status != "success" && it.property?.required == true }.map { it.name } if (failedResolution.isNotEmpty()) { - log.error("Failed to resolve required resources($failedResolution)") - bluePrintRuntimeService.setBluePrintError(resourceAssignmentRuntimeService.getBluePrintError()) + // The following error message is returned by default to handle a scenario when + // error message comes empty even when resolution has actually failed. + // Example: input-source type resolution seems to fail with no error code. + bluePrintRuntimeService.getBluePrintError().errors.add("Failed to resolve required resources($failedResolution)") + bluePrintRuntimeService.getBluePrintError().errors.addAll(resourceAssignmentRuntimeService.getBluePrintError().errors) } } return ResourceResolutionResult(templateMap, assignmentMap)