private static final String PASSWORD = "Password";
private static final String APPC_PROPS = "/appc.properties";
private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR";
- private static final String propDir = System.getenv(SDNC_CONFIG_DIR);
+ private static final String PROPDIR = System.getenv(SDNC_CONFIG_DIR);
private static final String SERVERIP = "ServerIP";
private Properties props;
private int defaultTimeout = 600 * 1000;
/**
* Connection object
**/
- private ConnectionBuilder httpClient;
+ //private ConnectionBuilder httpClient;
/**
* Ansible API Message Handlers
* data
*/
private void initialize() {
- String path = propDir + APPC_PROPS;
+ String path = PROPDIR + APPC_PROPS;
File propFile = new File(path);
props = new Properties();
try {
private ConnectionBuilder getHttpConn(int timeout, String serverIP) {
- String path = propDir + APPC_PROPS;
+ String path = PROPDIR + APPC_PROPS;
File propFile = new File(path);
props = new Properties();
InputStream input;
doFailure(ctx, testResult.getStatusCode(),
"Error posting request. Reason = " + testResult.getStatusMessage());
}
- String output = StringUtils.EMPTY;
code = testResult.getStatusCode();
message = testResult.getStatusMessage();
- output = testResult.getOutput();
+ String output = testResult.getOutput();
ctx.setAttribute(OUTPUT_ATTRIBUTE_NAME, output);
String serverIp = testResult.getServerIp();
if (StringUtils.isBlank(serverIp))
String vmKey = "tmp.vnfInfo.vm[" + Integer.toString(i) + "]";
logger.info("Looking for attributes of: " + vmKey);
if (ctx.getAttribute(vmKey + ".vnfc-name") != null) {
+ String debugText = "Auto Node List candidate ";
String vmVnfcName = ctx.getAttribute(vmKey + ".vnfc-name");
String vmVnfcIpv4Address = ctx.getAttribute(vmKey + ".vnfc-ipaddress-v4-oam-vip");
String vmVnfcType = ctx.getAttribute(vmKey + ".vnfc-type");
if (vServerId != null) {
String vmVserverId = ctx.getAttribute(vmKey + ".vserver-id");
if (vmVserverId == null || !vmVserverId.equals(vServerId)) {
- logger.debug("Auto Node List candidate " + vmVnfcName + " dropped. vserver-id mismatch");
+ logger.debug(debugText + vmVnfcName + " dropped. vserver-id mismatch");
continue;
}
}
if (vfModuleId != null) {
String vmVfModuleId = ctx.getAttribute(vmKey + ".vf-module-id");
if (vmVfModuleId == null || !vmVfModuleId.equals(vfModuleId)) {
- logger.debug("Auto Node List candidate " + vmVnfcName + " dropped. vf-module-id mismatch");
+ logger.debug(debugText + vmVnfcName + " dropped. vf-module-id mismatch");
continue;
}
}
if (vnfcName != null) {
if (!vmVnfcName.equals(vnfcName)) {
- logger.debug("Auto Node List candidate " + vmVnfcName + " dropped. vnfc-name mismatch");
+ logger.debug(debugText + vmVnfcName + " dropped. vnfc-name mismatch");
continue;
}
}
if (vnfcType != null) {
if (!vmVnfcType.equals(vnfcType)) {
- logger.debug("Auto Node List candidate " + vmVnfcType + " dropped. vnfc-type mismatch");
+ logger.debug(debugText + vmVnfcType + " dropped. vnfc-type mismatch");
continue;
}
}
- logger.info("Auto Node List candidate " + vmVnfcName + " [" + vmVnfcIpv4Address + "," + vmVnfcType + "]");
+ logger.info(debugText + vmVnfcName + " [" + vmVnfcIpv4Address + "," + vmVnfcType + "]");
JSONObject vnfTypeCandidates = null;
JSONArray vmList = null;