diff options
| author | Selvasundaram <selvam@gluster.com> | 2011-08-23 12:40:29 +0530 |
|---|---|---|
| committer | Selvasundaram <selvam@gluster.com> | 2011-08-23 12:40:29 +0530 |
| commit | fb44cc8ca62eb9b391e04cf816e8ee103be99f2d (patch) | |
| tree | 156dc8d1c4c612202da49f3f187956b937c8d0fc | |
| parent | 7391ff3c84bee1fc85aeffcaea1943d05ef29043 (diff) | |
| parent | 08689422177d9f6a4ee7428e7cc0e39f60e6bb31 (diff) | |
Merge branch 'master' of github.com:gluster/console
| -rw-r--r-- | src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/SshUtil.java | 4 |
1 files changed, 3 insertions, 1 deletions
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 b3e9072a..96c2b5fc 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 @@ -83,7 +83,7 @@ public class SshUtil { public boolean isPublicKeyInstalled(String serverName) { try { - getConnection(serverName); + getConnectionWithPubKey(serverName).close(); return true; } catch(ConnectionException e) { return false; @@ -172,6 +172,7 @@ public class SshUtil { private synchronized Connection getConnectionWithPassword(String serverName) { Connection conn = createConnection(serverName); if(!authenticateWithPassword(conn)) { + conn.close(); throw new ConnectionException("SSH Authentication (password) failed for server [" + conn.getHostname() + "]"); } @@ -181,6 +182,7 @@ public class SshUtil { private synchronized Connection getConnectionWithPubKey(String serverName) { Connection conn = createConnection(serverName); if(!authenticateWithPublicKey(conn)) { + conn.close(); throw new ConnectionException("SSH Authentication (public key) failed for server [" + conn.getHostname() + "]"); } |
