summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShireesh Anjal <shireesh@gluster.com>2011-08-09 14:51:30 +0530
committerShireesh Anjal <shireesh@gluster.com>2011-08-09 16:26:55 +0530
commit067cfc90c44e1aa5a0ed7489d6d0da7d35230d9c (patch)
tree4947d7658159d5f4270e322b0e028b54ac85981e /src
parent6e832692c1310d4c1d7430dc5a62158ac2ef0385 (diff)
Modified to delete temporary after installing public key.
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, 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 7c14bf52..9f5e1072 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
@@ -131,12 +131,14 @@ public class SshUtil {
outputStream.close();
} catch (Exception e) {
throw new GlusterRuntimeException("Couldnt append file [" + localTempFile + "] with public key!", e);
- }
+ }
try {
scpClient.put(localTempFile.getAbsolutePath(), SSH_AUTHORIZED_KEYS_FILE, SSH_AUTHORIZED_KEYS_DIR_REMOTE, "0600");
} catch (IOException e) {
throw new GlusterRuntimeException("Couldn't add public key to server [" + serverName + "]", e);
+ } finally {
+ localTempFile.delete();
}
// It was decided NOT to disable password login as this may not be acceptable in a bare-metal environment