summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt3
-rw-r--r--ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt6
-rw-r--r--ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt6
3 files changed, 13 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt
index c7d5105b4..cc323adb3 100644
--- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt
+++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt
@@ -1,6 +1,8 @@
/*
* Copyright © 2019 IBM.
*
+ * Modifications Copyright © 2020 IBM, Bell Canada.
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -21,6 +23,7 @@ open class SshClientProperties {
lateinit var host: String
var port: Int = 22
var connectionTimeOut: Long = 3000
+ var logging: Boolean = false // print command result in cds logs
}
open class BasicAuthSshClientProperties : SshClientProperties() {
diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt
index ee7a7dead..a7702d4fb 100644
--- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt
+++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt
@@ -1,6 +1,8 @@
/*
* Copyright © 2018-2019 AT&T Intellectual Property.
*
+ * Modifications Copyright © 2020 Bell Canada.
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -94,6 +96,10 @@ open class SshClientPropertiesAssignmentBuilder : PropertiesAssignmentBuilder()
fun host(host: String) = host(host.asJsonPrimitive())
fun host(host: JsonNode) = property(SshClientProperties::host.name, host)
+
+ fun logging(logging: Boolean) = logging(logging.asJsonPrimitive())
+
+ fun logging(logging: JsonNode) = property(SshClientProperties::logging.name, logging)
}
class BasicAuthSshClientPropertiesAssignmentBuilder : SshClientPropertiesAssignmentBuilder() {
diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt
index 2885d6528..a3c730039 100644
--- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt
+++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt
@@ -1,7 +1,7 @@
/*
* Copyright © 2019 IBM.
*
- * Modifications Copyright © 2018-2019 IBM, Bell Canada
+ * Modifications Copyright © 2018-2020 IBM, Bell Canada.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -118,7 +118,9 @@ open class BasicAuthSshClientService(private val basicAuthSshClientProperties: B
}
val commandResult = CommandResult(command, deviceOutput, isSuccessful)
- log.info("Command Response: ({}) $newLine", commandResult)
+ if (basicAuthSshClientProperties.logging) {
+ log.info("Command Response: ({}) $newLine", commandResult)
+ }
return commandResult
}