Arik Hadas has uploaded a new change for review.

Change subject: webadmin: prevent class cast exception on import vm
......................................................................

webadmin: prevent class cast exception on import vm

This patch is a workaround for a problem with StorageDisksListModel that
cause class-cast exception: in ImportVmFromExportDomainModel we set the
items in StorageDisksListModel to StorageDomains. However, in
StorageDisksListModel#updateActionAvailability we expect the
getSelectedItems method to return DiskImages.

Probably something went wrong in b13dc92e where StorageDisksListModel
was introduced in ImportVmFromExportDomainModel. This patch is only a
workaround that eliminates the error by clearing the storage-domain
before loading new ones so the previous selected item will be null and
we won't get that exception. Proper solution should be introduced
separately.

Change-Id: I28f9eee614ba5e6eeef9f8aa88337aab9a90a2f9
Signed-off-by: Arik Hadas <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/56/40056/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java
index 0a4f7c1..6d73f65 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java
@@ -240,6 +240,7 @@
                                
getCluster().setSelectedItem(Linq.firstOrDefault(clusters));
                            }
 
+                           getStorage().setItems(null);
                            // get storage domains
                            
AsyncDataProvider.getInstance().getStorageDomainList(new 
AsyncQuery(ImportVmFromExportDomainModel.this,
                                    new INewAsyncCallback() {


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

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

Reply via email to