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 | |
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')
2 files changed, 8 insertions, 10 deletions
diff --git a/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/Constants.java b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/Constants.java index d3ed28a75..85a142245 100644 --- a/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/Constants.java +++ b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/Constants.java @@ -44,7 +44,7 @@ public class Constants { public static final String REQUEST_ID_FIELD_NAME = "REQUEST_ID"; public static final String CREATION_DATE_FIELD_NAME = "CREATION_DATE"; public static final String LOG_FIELD_NAME = "LOG"; - public static final String ASDC_ARTIFACTS_TABLE_NAME = "ASDC_ARTIFACTS"; + public static final String SDC_ARTIFACTS_TABLE_NAME = "ASDC_ARTIFACTS"; // input fields names public static final String PAYLOAD = "payload"; 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); } } |