Fix health check issues with vLBMS
[demo.git] / vnfs / vLBMS / apis / health-vnf-onap-plugin / health-vnf-onap-plugin-impl / src / main / java / org / onap / vnf / health / read / ElementStateCustomizer.java
index 15d0c22..b83ccef 100644 (file)
@@ -168,9 +168,12 @@ public final class ElementStateCustomizer implements InitializingReaderCustomize
                // check all the vDNS instances
                Map<String, VdnsInstance> activeVdnsInstances = dnsInstanceManager.getDnsInstancesAsMap();
                Iterator<String> iter = activeVdnsInstances.keySet().iterator();
-               while(iter.hasNext()){
-                       if(!getRemoteVnfcHealthStatus(activeVdnsInstances.get(iter.next()).getOamIpAddr())) {
-                               healthStatus = "unhealthy";
+               while(iter.hasNext()) {
+                       VdnsInstance vdns = activeVdnsInstances.get(iter.next());
+                       if(vdns.isEnabled()) {
+                               if(!getRemoteVnfcHealthStatus(vdns.getOamIpAddr())) {
+                                       healthStatus = "unhealthy";
+                               }
                        }
                }
        }