From b4a139bcccdabd195b4c7f68b88fdfce8eb01a59 Mon Sep 17 00:00:00 2001 From: Shireesh Anjal Date: Tue, 23 Aug 2011 12:49:57 +0530 Subject: Modified method executeCommand to throw ConnectionException if an IOException is encountered during ssh command execution --- .../src/com/gluster/storage/management/gateway/utils/SshUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 96c2b5fc..1a9f0460 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 @@ -313,9 +313,9 @@ public class SshUtil { logger.error(errMsg, e); // remove the connection from cache and close it - sshConnCache.remove(sshConnection); + sshConnCache.remove(sshConnection.getHostname()); sshConnection.close(); - if(e instanceof IllegalStateException) { + if(e instanceof IllegalStateException || e instanceof IOException) { // The connection is no more valid. Create and throw a connection exception. throw new ConnectionException("Couldn't open SSH session on [" + sshConnection.getHostname() + "]!", e); } else { -- cgit