Liron Ar has uploaded a new change for review.

Change subject: core: Removing template with disks ends with unused data in the 
db
......................................................................

core: Removing template with disks ends with unused data in the db

When removing a template, the records of it's disks weren't deleted from
base_disk table because the call to the delete stored procedure was done
with the id of the image rather then the id of the disk - which caused
to unused records to be left in the table and possible errors when
trying to import the template again (not as a clone).

Change-Id: I86573e91885085bcdfc30ee4e966590901a62067
Signed-off-by: Liron Aravot <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveAllVmTemplateImageTemplatesCommand.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/77/14877/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveAllVmTemplateImageTemplatesCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveAllVmTemplateImageTemplatesCommand.java
index 60f3310..a7b0c85 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveAllVmTemplateImageTemplatesCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveAllVmTemplateImageTemplatesCommand.java
@@ -76,7 +76,7 @@
             if (getParameters().isRemoveTemplateFromDb()) {
                 DiskImage diskImage = 
DbFacade.getInstance().getDiskImageDao().get(template.getImageId());
                 if (diskImage != null) {
-                    
DbFacade.getInstance().getBaseDiskDao().remove(template.getImageId());
+                    
DbFacade.getInstance().getBaseDiskDao().remove(template.getId());
                     DbFacade.getInstance()
                             .getVmDeviceDao()
                             .remove(new VmDeviceId(diskImage.getImageId(), 
getVmTemplateId()));


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

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

Reply via email to