* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
+ * Modifications Copyright (C) 2019 IBM
+ * =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
private AnsibleResult postExecRequest(String agentUrl, String payload, String user, String password,
SvcLogicContext ctx) {
- AnsibleResult testResult;
+ AnsibleResult testResult = null;
ConnectionBuilder httpClient = getHttpConn(defaultSocketTimeout, "");
if (!testMode) {
+ if(httpClient!=null) {
httpClient.setHttpContext(user, password);
testResult = httpClient.post(agentUrl, payload);
httpClient.close();
+ }
} else {
testResult = testServer.Post(agentUrl, payload);
}
logger.info("Querying ansible GetResult URL = " + agentUrl);
if (!testMode) {
+ if(httpClient!=null) {
httpClient.setHttpContext(user, password);
testResult = httpClient.get(agentUrl);
httpClient.close();
+ }
} else {
testResult = testServer.Get(agentUrl);
}