Omer Frenkel has uploaded a new change for review.

Change subject: core: fix import of cloned template
......................................................................

core: fix import of cloned template

When importing template as clone, it set wrong template base id,
as the id of the template is re-generated.
cloned import is a new entity so it should always be a base template

Change-Id: Ia8cdd44a1803995d28b806668dfdb6ea8e59597e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1073019
Signed-off-by: Omer Frenkel <ofren...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/92/25892/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
index a4063b5..8d9bc0f 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
@@ -237,10 +237,13 @@
     }
 
     private void initImportClonedTemplate() {
-        getParameters().getVmTemplate().setId(Guid.newGuid());
+        Guid newTemplateId = Guid.newGuid();
+        getParameters().getVmTemplate().setId(newTemplateId);
         for (VmNetworkInterface iface : 
getParameters().getVmTemplate().getInterfaces()) {
             iface.setId(Guid.newGuid());
         }
+        // cloned template is always base template, as its a new entity
+        getParameters().getVmTemplate().setBaseTemplateId(newTemplateId);
     }
 
     private void initImportClonedTemplateDisks() {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8cdd44a1803995d28b806668dfdb6ea8e59597e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Omer Frenkel <ofren...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to