diff options
author | Arun Arora <aroraarun@vmware.com> | 2017-11-09 18:01:14 +0530 |
---|---|---|
committer | Arun Arora <aroraarun@vmware.com> | 2017-11-09 18:01:14 +0530 |
commit | 97ae8f2529f7a4976848bc194db3488d912e541b (patch) | |
tree | 1d483dbb3572377c53179a856eab57d160d725cf | |
parent | 60644a0117ee7f55930ecf2fdd5f03551b703c9f (diff) |
VMWare vesagent integration tests bug fixes
1. Fix the schema text for Alarm OFF event
2. Fix for maintaining VES Send state in case of Error Response
Change-Id: I336fa7cab22ed409c2deb6f99528c04e32fa44af
Issue-ID: MULTICLOUD-8
Signed-off-by: Arun Arora <aroraarun@vmware.com>
-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"; |