From e91b51032948ef7e10c0a91de1f72635c1b0d04d Mon Sep 17 00:00:00 2001 From: Shireesh Anjal Date: Fri, 19 Aug 2011 19:08:22 +0530 Subject: Added extra log messages --- .../src/com/gluster/storage/management/gateway/utils/SshUtil.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/SshUtil.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/SshUtil.java index a5735cae..3399dc3b 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/SshUtil.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/SshUtil.java @@ -334,6 +334,7 @@ public class SshUtil { * @return Result of remote execution */ public ProcessResult executeRemoteWithPassword(String serverName, String command) { + logger.info("Executing command [" + command + "] on server [" + serverName + "] with default password."); Connection conn = getConnectionWithPassword(serverName); ProcessResult result = executeCommand(conn, command); // we don't cache password based connections. hence the connection must be closed. @@ -366,8 +367,10 @@ public class SshUtil { */ public ProcessResult executeRemote(String serverName, String command) { try { + logger.info("Executing command [" + command + "] on server [" + serverName + "] with public key authentication"); return executeRemoteWithPubKey(serverName, command); } catch(ConnectionException e) { + logger.warn("Couldn't execute command with public key authentication, will try with default password.", e); // Couldn't connect with public key. Try with default password. return executeRemoteWithPassword(serverName, command); } -- cgit