summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/ssh-lib/src
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2019-07-24 22:34:39 -0400
committerBrinda Santh <brindasanth@in.ibm.com>2019-07-24 22:34:39 -0400
commit88e24883c8e22711062ad451250ff7e3646485b3 (patch)
treedfc52871d9a5884e321ac6e32e239169dfff2603 /ms/blueprintsprocessor/modules/commons/ssh-lib/src
parentef03bd490adb4483fc0dd0f8726f33ba6187804a (diff)
Fix attribute validation for complex type.
Change-Id: I7a3365c4c26fd44ed0b54bff115b64c52ee7b81e Issue-ID: CCSDK-1046 Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/ssh-lib/src')
-rw-r--r--ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt3
1 files changed, 2 insertions, 1 deletions
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,