summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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 {