diff options
Diffstat (limited to 'appc-adapters')
-rw-r--r-- | appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleMessageParser.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleMessageParser.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleMessageParser.java index 6aee75631..5f6259c03 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleMessageParser.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleMessageParser.java @@ -150,6 +150,7 @@ public class AnsibleMessageParser { ansibleResult = new AnsibleResult(code, msg); } catch (JSONException e) { + LOGGER.error("JSONException: Error parsing response", e); ansibleResult = new AnsibleResult(600, "Error parsing response = " + input + ". Error = " + e.getMessage()); } return ansibleResult; @@ -167,6 +168,7 @@ public class AnsibleMessageParser { JSONObject postResponse = new JSONObject(input); ansibleResult = parseGetResponseNested(ansibleResult, postResponse); } catch (JSONException e) { + LOGGER.error("JSONException: Error parsing response", e); ansibleResult = new AnsibleResult(AnsibleResultCodes.INVALID_PAYLOAD.getValue(), "Error parsing response = " + input + ". Error = " + e.getMessage(), ""); } @@ -213,10 +215,11 @@ public class AnsibleMessageParser { LOGGER.info("Code = {}, Message = {}", subCode, message); - if (subCode != 200 || !message.equals("SUCCESS")) { + if (subCode != 200 || !(("SUCCESS").equals(message))) { finalCode = AnsibleResultCodes.REQ_FAILURE.getValue(); } } catch (JSONException e) { + LOGGER.error("JSONException: Error parsing response", e); ansibleResult.setStatusCode(AnsibleResultCodes.INVALID_RESPONSE.getValue()); ansibleResult.setStatusMessage(String.format( "Error processing response message = %s from host %s", results.getString(host), host)); |