Shubhendu Tripathi has uploaded a new change for review.

Change subject: webadmin: List only the cluster with nodes attached
......................................................................

webadmin: List only the cluster with nodes attached

Modified to list only the clusters which have nodes
attached during cluster volume snapshot configurations
manipulation.

Change-Id: I1d4dac68de44cecfc853b2388c23bfe3d1cc09cf
Bug-Url: https://bugzilla.redhat.com/1202391
Signed-off-by: Shubhendu Tripathi <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
2 files changed, 23 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/70/40870/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
index 19556db..c92658b 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
@@ -1875,6 +1875,25 @@
         
Frontend.getInstance().runQuery(VdcQueryType.GetClustersWithPermittedAction, 
getEntitiesWithPermittedActionParameters, aQuery);
     }
 
+    public static void getClustersHavingHosts(AsyncQuery aQuery) {
+        aQuery.converterCallback = new IAsyncConverter() {
+            @Override
+            public Object Convert(Object source, AsyncQuery _asyncQuery)
+            {
+                if (source != null)
+                {
+                    ArrayList<VDSGroup> list = (ArrayList<VDSGroup>) source;
+                    Collections.sort(list, new NameableComparator());
+                    return list;
+                }
+                return new ArrayList<VDSGroup>();
+            }
+        };
+        Frontend.getInstance().runQuery(VdcQueryType.GetAllClustersHavingHosts,
+                new VdcQueryParametersBase(),
+                aQuery);
+    }
+
     public static void getAllVmTemplates(AsyncQuery aQuery, final boolean 
refresh) {
         aQuery.converterCallback = new TemplateConverter();
         VdcQueryParametersBase params = new VdcQueryParametersBase();
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
index 60ff035..66f91dc 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
@@ -1255,7 +1255,7 @@
                 .configureClusterSnapshotOptionsTitle());
         setWindow(clusterSnapshotConfigModel);
 
-        AsyncDataProvider.getClusterList(new AsyncQuery(this, new 
INewAsyncCallback() {
+        AsyncDataProvider.getClustersHavingHosts(new AsyncQuery(this, new 
INewAsyncCallback() {
 
             @Override
             public void onSuccess(Object model, final Object returnValue) {
@@ -1270,7 +1270,9 @@
 
                                 @Override
                                 public void onSuccess(Object model, Object 
returnValue1) {
-                                    
clusterSnapshotConfigModel.getClusters().setItems((List<VDSGroup>) returnValue, 
(VDSGroup) returnValue1);
+                                            
clusterSnapshotConfigModel.getClusters()
+                                                    .setItems((List<VDSGroup>) 
returnValue,
+                                                    (VDSGroup) returnValue1);
                                 }
                             }), volumeEntity.getClusterId());
                         }


-- 
To view, visit https://gerrit.ovirt.org/40870
To unsubscribe, visit https://gerrit.ovirt.org/settings

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

Reply via email to