Omer Frenkel has uploaded a new change for review.

Change subject: core, ui: fix broken update template
......................................................................

core, ui: fix broken update template

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1064907
Change-Id: I302eb7754d2abe6a3073cd44885c82809a868178
Signed-off-by: Omer Frenkel <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplatesByStoragePoolIdQuery.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
3 files changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/82/25182/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplatesByStoragePoolIdQuery.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplatesByStoragePoolIdQuery.java
index bf40ea3..caa6842 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplatesByStoragePoolIdQuery.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmTemplatesByStoragePoolIdQuery.java
@@ -27,9 +27,10 @@
 
         if (returnValue != null && returnValue.getSucceeded()) {
             List<VmTemplate> templateList = returnValue.getReturnValue();
-            // Load VmInit
+            // Load VmInit and disks
             for(VmTemplate template: templateList) {
                 VmHandler.updateVmInitFromDB(template, true);
+                VmTemplateHandler.updateDisksFromDb(template);
             }
             VmTemplate blank = DbFacade.getInstance().getVmTemplateDao()
                     .get(VmTemplateHandler.BLANK_VM_TEMPLATE_ID);
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
index 28dbe9f..d28de31 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
@@ -463,7 +463,7 @@
             return;
         }
 
-        VmTemplate selectedItem = (VmTemplate) getSelectedItem();
+        VmTemplate selectedItem = ((TemplateVmModelBehavior) 
model.getBehavior()).getVmTemplate();
         final VmTemplate template = (VmTemplate) Cloner.clone(selectedItem);
 
         String name = model.getName().getEntity();
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
index 2970f4ee..56a3ce9 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
@@ -226,4 +226,8 @@
         updateCdImage();
     }
 
+    public VmTemplate getVmTemplate() {
+        return template;
+    }
+
 }


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

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

Reply via email to