diff options
author | kusuma kumari M <km583p@att.com> | 2018-01-09 11:19:57 -0500 |
---|---|---|
committer | Skip Wonnell <skip@att.com> | 2018-01-09 17:25:27 +0000 |
commit | 9f4b9299a1bdfaffb669fb051707d3e540a9f529 (patch) | |
tree | 22e9123a68145a77b782865a8438781c5dc94683 /appc-adapters/appc-ssh-adapter/appc-ssh-adapter-sshd | |
parent | 55f9e7db829f1d8d01a71a8e44388f2c4f49d004 (diff) |
platform hardening changes for appc-adapters
Issue-ID: APPC-362
Change-Id: I5dfcee3ea542b130916b055b408f89240e513bba
Signed-off-by: kusuma kumari M <km583p@att.com>
Diffstat (limited to 'appc-adapters/appc-ssh-adapter/appc-ssh-adapter-sshd')
-rw-r--r-- | appc-adapters/appc-ssh-adapter/appc-ssh-adapter-sshd/src/main/java/org/onap/appc/adapter/ssh/sshd/SshConnectionSshd.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-sshd/src/main/java/org/onap/appc/adapter/ssh/sshd/SshConnectionSshd.java b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-sshd/src/main/java/org/onap/appc/adapter/ssh/sshd/SshConnectionSshd.java index c35c58798..44cedc3bb 100644 --- a/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-sshd/src/main/java/org/onap/appc/adapter/ssh/sshd/SshConnectionSshd.java +++ b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-sshd/src/main/java/org/onap/appc/adapter/ssh/sshd/SshConnectionSshd.java @@ -117,9 +117,9 @@ class SshConnectionSshd implements SshConnection { @Override public void connectWithRetry() { - int retryCount = 0; - int retryDelay = 0; - int retriesLeft = 0; + int retryCount ; + int retryDelay ; + int retriesLeft; retryCount = configuration.getIntegerProperty(Constants.CONNECTION_RETRY_COUNT, Constants.DEFAULT_CONNECTION_RETRY_COUNT); retryDelay = configuration.getIntegerProperty(Constants.CONNECTION_RETRY_DELAY, @@ -139,9 +139,7 @@ class SshConnectionSshd implements SshConnection { } else { throw e; } - } catch (Exception e) { - throw e; - } + } } while (retriesLeft > 0); } @@ -184,7 +182,7 @@ class SshConnectionSshd implements SshConnection { client.setOut(out); client.setErr(err); OpenFuture openFuture = client.open(); - int exitStatus = 0; + int exitStatus; try { client.waitFor(ClientChannel.CLOSED, timeout); openFuture.verify(); @@ -200,9 +198,9 @@ class SshConnectionSshd implements SshConnection { return exitStatus; } catch (RuntimeException e) { throw e; - } catch (Exception t) { + } catch (Exception e1) { throw new SshException( - "Error executing command [" + cmd + "] over SSH [" + username + "@" + host + ":" + port + "]", t); + "Error executing command [" + cmd + "] over SSH [" + username + "@" + host + ":" + port + "]", e1); } } |