You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2022/08/30 10:59:00 UTC
[brooklyn-server] 03/04: Do not ignore privateKeyFile in SSH CLI tool
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit 2c05c97819b6304c6722b8950334e7105f3670b4
Author: Mykola Mandra <my...@cloudsoft.io>
AuthorDate: Tue Aug 30 11:39:58 2022 +0100
Do not ignore privateKeyFile in SSH CLI tool
Signed-off-by: Mykola Mandra <my...@cloudsoft.io>
---
.../org/apache/brooklyn/util/core/internal/ssh/cli/SshCliTool.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/cli/SshCliTool.java b/core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/cli/SshCliTool.java
index 6ef753775d..581531e1a8 100644
--- a/core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/cli/SshCliTool.java
+++ b/core/src/main/java/org/apache/brooklyn/util/core/internal/ssh/cli/SshCliTool.java
@@ -221,7 +221,7 @@ public class SshCliTool extends SshAbstractTool implements SshTool {
try {
final String scpPassword = Strings.isEmpty(password) ? "" : password;
- final File scpKeyFile = Objects.isNull(privateKeyFile) ? tempKeyFile : null;
+ final File scpKeyFile = Objects.isNull(privateKeyFile) ? tempKeyFile : privateKeyFile;
List<String> cmd = Lists.newArrayList();
cmd.add(getOptionalVal(props, PROP_SCP_EXECUTABLE, scpExecutable));
@@ -273,7 +273,7 @@ public class SshCliTool extends SshAbstractTool implements SshTool {
final String sshUser = Strings.isEmpty(getUsername()) ? "" : getUsername();
final String sshHost = getHostAddress();
final String sshPassword = Strings.isEmpty(password) ? "" : password;
- final File sshKeyFile = Objects.isNull(privateKeyFile) ? tempKeyFile : null;
+ final File sshKeyFile = Objects.isNull(privateKeyFile) ? tempKeyFile : privateKeyFile;
List<String> cmd = Lists.newArrayList();
cmd.add(getOptionalVal(props, PROP_SSH_EXECUTABLE, sshExecutable));