Shubhendu Tripathi has uploaded a new change for review.

Change subject: gluster: Correct SWIF status if no hosts in cluster
......................................................................

gluster: Correct SWIF status if no hosts in cluster

If there are no hosts available under a cluster the SWIFT status was
being displayed as Up. Corrected the same to show Unknown is no hosts
available under a cluster or removed all the hosts from the cluster.

Change-Id: I17080ac2d3eb5ec87b2efcc86bdca750995bce0e
Bug-Url: https://bugzilla.redhat.com/974560
Signed-off-by: Shubhendu Tripathi <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterServiceSyncJob.java
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/73/16573/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterServiceSyncJob.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterServiceSyncJob.java
index b6e7caf..87636a1 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterServiceSyncJob.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterServiceSyncJob.java
@@ -57,6 +57,15 @@
             if (supportsGlusterServicesFeature(cluster)) {
                 try {
                     List<VDS> serversList = 
getClusterUtils().getAllServers(cluster.getId());
+                    // If there are no servers in the cluster, set the status 
as unknown
+                    if(serversList != null && serversList.size() == 0) {
+                        Map<ServiceType, GlusterServiceStatus> statusMap = new 
HashMap<>();
+                        for(ServiceType type : 
getClusterServiceMap(cluster).keySet()) {
+                            statusMap.put(type, GlusterServiceStatus.UNKNOWN);
+                        }
+                        addOrUpdateClusterServices(cluster, statusMap);
+                        break;
+                    }
                     List<Callable<Map<String, GlusterServiceStatus>>> taskList 
= createTaskList(serversList);
                     if (taskList != null && taskList.size() > 0) {
                         refreshClusterServices(cluster, 
ThreadPoolUtil.invokeAll(taskList));


-- 
To view, visit http://gerrit.ovirt.org/16573
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I17080ac2d3eb5ec87b2efcc86bdca750995bce0e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shubhendu Tripathi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to