summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShireesh Anjal <shireesh@gluster.com>2011-08-23 12:49:57 +0530
committerShireesh Anjal <shireesh@gluster.com>2011-08-23 12:50:51 +0530
commitb4a139bcccdabd195b4c7f68b88fdfce8eb01a59 (patch)
tree5ac9c811234acb9802ed1ef184ed97eef5bd0ea3 /src
parent722ddc0b18f676598f8bd06f6c8f9ef12987a138 (diff)
Modified method executeCommand to throw ConnectionException if an IOException is encountered during ssh command execution
Diffstat (limited to 'src')
-rw-r--r--src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/SshUtil.java4
1 files changed, 2 insertions, 2 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 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 {