summaryrefslogtreecommitdiffstats
path: root/ansible-adapter/ansible-adapter-bundle
diff options
context:
space:
mode:
authorezhil <ezhrajam@in.ibm.com>2018-12-26 15:31:19 +0530
committerezhil <ezhrajam@in.ibm.com>2018-12-26 15:31:32 +0530
commit79e58ee4a2fae09a77042d10e675df4161ed0c6f (patch)
tree768f5232e0c86e95b6fd6e0e2a6fd6d4d5e767ba /ansible-adapter/ansible-adapter-bundle
parent5df4fb30eaf3bbbd6ac5802a8f75fcf8c19d4e6f (diff)
Fixed sonar fix in AnsibleAdapterImpl.java
Fixed sonar issue Issue-ID: CCSDK-837 Change-Id: I4a6b82a7e499763f90b49ae152f701cec89c0ca0 Signed-off-by: ezhil <ezhrajam@in.ibm.com>
Diffstat (limited to 'ansible-adapter/ansible-adapter-bundle')
-rw-r--r--ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdapterImpl.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdapterImpl.java b/ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdapterImpl.java
index 3d14a71c..79103dbb 100644
--- a/ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdapterImpl.java
+++ b/ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdapterImpl.java
@@ -79,9 +79,9 @@ public class AnsibleAdapterImpl implements AnsibleAdapter {
private static final String CLIENT_TYPE_PROPERTY_NAME = "org.onap.appc.adapter.ansible.clientType";
private static final String TRUSTSTORE_PROPERTY_NAME = "org.onap.appc.adapter.ansible.trustStore";
- private static final String TRUSTPASSWD_PROPERTY_NAME = "org.onap.appc.adapter.ansible.trustStore.trustPasswd";
+ private static final String TRUSTPASSD_PROPERTY_NAME = "org.onap.appc.adapter.ansible.trustStore.trustPasswd";
- private static final String PASSWORD = "Password";
+ private static final String PASSD = "Password";
/**
* The logger to be used
@@ -184,7 +184,7 @@ public class AnsibleAdapterImpl implements AnsibleAdapter {
} else if ("TRUST_CERT".equals(clientType)) {
// set path to keystore file
String trustStoreFile = props.getProperty(TRUSTSTORE_PROPERTY_NAME);
- String key = props.getProperty(TRUSTPASSWD_PROPERTY_NAME);
+ String key = props.getProperty(TRUSTPASSD_PROPERTY_NAME);
char[] trustStorePasswd = key.toCharArray();
logger.info("Creating http client with trustmanager from " + trustStoreFile);
httpClient = new ConnectionBuilder(trustStoreFile, trustStorePasswd);
@@ -222,7 +222,7 @@ public class AnsibleAdapterImpl implements AnsibleAdapter {
agentUrl = (String) jsonPayload.remove("AgentUrl");
user = (String) jsonPayload.remove("User");
- password = (String) jsonPayload.remove(PASSWORD);
+ password = (String) jsonPayload.remove(PASSD);
id = jsonPayload.getString("Id");
payload = jsonPayload.toString();
logger.info("Updated Payload = " + payload);
@@ -316,7 +316,7 @@ public class AnsibleAdapterImpl implements AnsibleAdapter {
try {
// Try to retrieve the test results (modify the URL for that)
- AnsibleResult testResult = queryServer(reqUri, params.get("User"), params.get(PASSWORD));
+ AnsibleResult testResult = queryServer(reqUri, params.get("User"), params.get(PASSD));
code = testResult.getStatusCode();
message = testResult.getStatusMessage();
@@ -331,6 +331,7 @@ public class AnsibleAdapterImpl implements AnsibleAdapter {
logger.info("Request response = " + message);
} catch (SvcLogicException e) {
+ logger.error(APPC_EXCEPTION_CAUGHT, e);
doFailure(ctx, AnsibleResultCodes.UNKNOWN_EXCEPTION.getValue(),
"Exception encountered retrieving result : " + e.getMessage());
return;
@@ -377,7 +378,7 @@ public class AnsibleAdapterImpl implements AnsibleAdapter {
String message = StringUtils.EMPTY;
try {
// Try to retrieve the test results (modify the url for that)
- AnsibleResult testResult = queryServer(reqUri, params.get("User"), params.get(PASSWORD));
+ AnsibleResult testResult = queryServer(reqUri, params.get("User"), params.get(PASSD));
message = testResult.getStatusMessage();
logger.info("Request output = " + message);
ctx.setAttribute(LOG_ATTRIBUTE_NAME, message);