diff options
author | xinhuili <lxinhui@vmware.com> | 2017-11-10 08:50:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-11-10 08:50:38 +0000 |
commit | 00574ef9f28c88a59a9bb18f6179697cc732754f (patch) | |
tree | 13b06e53a374568dd1aa75a483186b8dc26dcdf2 /vesagent/src | |
parent | de4fe0e7eea7a2e3f49d5e7307441767083c00ad (diff) | |
parent | 97ae8f2529f7a4976848bc194db3488d912e541b (diff) |
Merge "VMWare vesagent integration tests bug fixes"v1.0.01.0.0-ONAP1.0.0-Amsterdam
Diffstat (limited to 'vesagent/src')
-rw-r--r-- | vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VESRestAPI.java | 18 | ||||
-rw-r--r-- | vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereData.java | 2 |
2 files changed, 13 insertions, 7 deletions
diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VESRestAPI.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VESRestAPI.java index 9fef06e..5298261 100644 --- a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VESRestAPI.java +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VESRestAPI.java @@ -60,11 +60,11 @@ public class VESRestAPI{ post.setHeader("Content-type", applicationJson); HttpResponse response = client.execute(post); log.info(response.getStatusLine().toString()); + sock.close(); + client.close(); if(vESCollectorSendStatus(response,map,uuidKey,list,timer,vesSendStatus)){ return true; } - sock.close(); - client.close(); } }catch(Exception e){ log.info("VES Collector connection refused, exception occured"); @@ -101,6 +101,8 @@ public class VESRestAPI{ post.addHeader("Accept", applicationJson); HttpResponse response = client.execute(post); log.info(response.getStatusLine().toString()); + sock.close(); + client.close(); if(!connectionRefused(response)){ return true; } @@ -108,8 +110,6 @@ public class VESRestAPI{ return true; } } - sock.close(); - client.close(); }catch(Exception e){ log.info("connection refused, exception occured"); log.error("error",e); @@ -135,7 +135,7 @@ public class VESRestAPI{ } - public boolean vESCollectorSendStatus ( HttpResponse response,JsonStoreMap map,String uuidKey, List<JsonAlarmStorage> list,VesTimer timer,String vesSendStatus) throws ParseException { + public boolean vESCollectorSendStatus ( HttpResponse response,JsonStoreMap map,String uuidKey, List<JsonAlarmStorage> list,VesTimer timer,String vesSendStatus) throws ParseException { JsonAlarmStorage store = list.get(0); log.info(String.valueOf(list.size())); log.info(store.alarm); @@ -172,8 +172,14 @@ public class VESRestAPI{ log.info("timer is not running...."); } return true; + }else if(response.getStatusLine().getStatusCode()>=400 && response.getStatusLine().getStatusCode()<600){ + if(alarmStatus == "OFF" && vesSendStatus=="new"){ + list.get(0).vesSendStatus = "failed"; + map.updateMap(uuidKey, list); + } + return true; }else{ - log.info("connection error !200"); + log.info("connection error"); return false; } } diff --git a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereData.java b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereData.java index f3dce32..e1a0b19 100644 --- a/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereData.java +++ b/vesagent/src/main/java/org/onap/multicloud/openstack/vmware/VsphereData.java @@ -82,7 +82,7 @@ public class VsphereData { else { eventName="Fault_MultiCloud_VMFailureCleared"; priority="Normal"; - eventSeverity="Normal" ; + eventSeverity="NORMAL" ; alarmCondition="Vm_Restart"; vfStatus="Active"; specificProblem="AlarmOff"; |