anmolbabu has uploaded a new change for review.

Change subject: webadmin : remove-brick status error handling
......................................................................

webadmin : remove-brick status error handling

Errors like,
1. If some/all the hosts forming a distribute volume with atleast 2 bricks are
   down, and if rebalance status is triggered on such a volume, approprite
   error message is displayed.
2. If any n/w related or any other exceptions are thrown,they are also
   handled properly.
And hence the popup doesn't hang anymore.

Change-Id: I57bb82ebc0318266f32262c6f9bb245e26f2ddd1
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1027675
Signed-off-by: Anmol Babu <[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/gluster/RemoveBrickStatusModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
3 files changed, 11 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/86/21086/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 52f312f..f15dbf7 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
@@ -61,7 +61,6 @@
 import org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
-import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity;
 import org.ovirt.engine.core.common.businessentities.gluster.ServiceType;
 import org.ovirt.engine.core.common.businessentities.network.Network;
 import 
org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;
@@ -1444,12 +1443,7 @@
             Guid clusterId,
             Guid volumeId,
             List<GlusterBrickEntity> bricks) {
-        aQuery.converterCallback = new 
IAsyncConverter<GlusterVolumeTaskStatusEntity>() {
-            @Override
-            public GlusterVolumeTaskStatusEntity Convert(Object source, 
AsyncQuery _asyncQuery) {
-                return (GlusterVolumeTaskStatusEntity) source;
-            }
-        };
+        aQuery.setHandleFailure(true);
         GlusterVolumeRemoveBricksQueriesParameters parameters =
                 new GlusterVolumeRemoveBricksQueriesParameters(clusterId, 
volumeId, bricks);
         Frontend.RunQuery(VdcQueryType.GetGlusterVolumeRemoveBricksStatus, 
parameters, aQuery);
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/RemoveBrickStatusModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/RemoveBrickStatusModel.java
index 10cdbbe..1909649 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/RemoveBrickStatusModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/RemoveBrickStatusModel.java
@@ -6,6 +6,7 @@
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity;
 import org.ovirt.engine.core.common.job.JobExecutionStatus;
+import org.ovirt.engine.core.common.queries.VdcQueryReturnValue;
 import org.ovirt.engine.ui.frontend.AsyncQuery;
 import org.ovirt.engine.ui.frontend.INewAsyncCallback;
 import org.ovirt.engine.ui.uicommonweb.UICommand;
@@ -76,7 +77,8 @@
         AsyncDataProvider.getGlusterRemoveBricksStatus(new AsyncQuery(this, 
new INewAsyncCallback() {
             @Override
             public void onSuccess(Object model, Object returnValue) {
-                GlusterVolumeTaskStatusEntity statusEntity = 
(GlusterVolumeTaskStatusEntity) returnValue;
+                VdcQueryReturnValue vdcValue = (VdcQueryReturnValue) 
returnValue;
+                GlusterVolumeTaskStatusEntity statusEntity = 
vdcValue.getReturnValue();
                 if (statusEntity != null) {
                     showStatus(statusEntity);
                 }
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
index 376de86..0c57c03 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
@@ -984,8 +984,13 @@
 
                 removeBrickStatusModel.stopProgress();
 
-                GlusterVolumeTaskStatusEntity removeBrickStatusEntity = 
(GlusterVolumeTaskStatusEntity) returnValue;
-                removeBrickStatusModel.showStatus(removeBrickStatusEntity);
+                VdcQueryReturnValue vdcValue = (VdcQueryReturnValue) 
returnValue;
+                if (vdcValue.getSucceeded()) {
+                    GlusterVolumeTaskStatusEntity removeBrickStatusEntity = 
vdcValue.getReturnValue();
+                    removeBrickStatusModel.showStatus(removeBrickStatusEntity);
+                } else {
+                    
removeBrickStatusModel.setMessage(vdcValue.getExceptionString());
+                }
             }
         }),
                 volumeEntity.getClusterId(),


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

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

Reply via email to