From 88e24883c8e22711062ad451250ff7e3646485b3 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Wed, 24 Jul 2019 22:34:39 -0400 Subject: Fix attribute validation for complex type. Change-Id: I7a3365c4c26fd44ed0b54bff115b64c52ee7b81e Issue-ID: CCSDK-1046 Signed-off-by: Brinda Santh --- .../blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ms/blueprintsprocessor/modules/commons/ssh-lib') diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt index 1950b71aa..829fdda8e 100644 --- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt @@ -52,7 +52,8 @@ open class BluePrintSshLibPropertyService(private var bluePrintProperties: BlueP } fun sshClientProperties(jsonNode: JsonNode): SshClientProperties { - val type = jsonNode.get("type").textValue() + val type = jsonNode.get("type")?.textValue() + ?: throw BluePrintProcessorException("missing type field in ssh client properties") return when (type) { SshLibConstants.TYPE_BASIC_AUTH -> { JacksonUtils.readValue(jsonNode, -- cgit 1.2.3-korg