Hello Shmuel Melamud,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/40241

to review the following change.

Change subject: core: Enable creation of non-stateless VMs from 'latest' 
templates
......................................................................

core: Enable creation of non-stateless VMs from 'latest' templates

Removed error message that appeared when user wanted to create a
non-stateless VM from 'latest' version of a template.

Change-Id: Ia6720b4c00fc81aa16838551c60891d91c8ae703
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1196570
Signed-off-by: Shmuel Melamud <smela...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromTemplateCommand.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M 
frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
4 files changed, 4 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/41/40241/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromTemplateCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromTemplateCommand.java
index f007c74..0408f6e 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromTemplateCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromTemplateCommand.java
@@ -142,16 +142,13 @@
         }
 
         for (DiskImage dit : getVmTemplate().getDiskTemplateMap().values()) {
-            if 
(!ImagesHandler.checkImageConfiguration(destStorages.get(diskInfoDestinationMap.get(dit.getId()).getStorageIds().get(0))
-                    .getStorageStaticData(),
-                    diskInfoDestinationMap.get(dit.getId()),
+            DiskImage diskImage = diskInfoDestinationMap.get(dit.getId());
+            if (!ImagesHandler.checkImageConfiguration(
+                    
destStorages.get(diskImage.getStorageIds().get(0)).getStorageStaticData(),
+                    diskImage,
                     getReturnValue().getCanDoActionMessages())) {
                 return false;
             }
-        }
-
-        if (getParameters().getVm().isUseLatestVersion()) {
-            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_USE_LATEST_WITH_CLONE);
         }
 
         return true;
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
index 077e772..f601ee0 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -189,7 +189,6 @@
 ACTION_TYPE_FAILED_VM_HAS_STATELESS_SNAPSHOT_LEFTOVER=Cannot ${action} 
${type}. The VM was running as Stateless and didn't clean up successfully. 
Please try to run the VM which should clean up the VM, and then try again when 
VM is not running.
 ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER=Cannot ${action} ${type}. The VM is 
in use by other user.
 ACTION_TYPE_FAILED_VM_NOT_FOUND=Cannot ${action} ${type}. VM is not found.
-ACTION_TYPE_FAILED_CANNOT_USE_LATEST_WITH_CLONE=Cannot ${action} ${type}. 
Cannot use 'Latest Version' when using clone from Template.
 ACTION_TYPE_FAILED_VM_NOT_SET_FOR_LATEST=Cannot ${action} ${type}. Vm is set 
to use a specific version, and not automatically update to the latest version.
 ACTION_TYPE_FAILED_VM_ALREADY_IN_LATEST_VERSION=Cannot ${action} ${type}. Vm 
is already at the latest version.
 ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE=Cannot ${action} ${type}. VM is non 
migratable.
diff --git 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index 8d9fb14..7b15419 100644
--- 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -170,7 +170,6 @@
 ACTION_TYPE_FAILED_VM_HAS_STATELESS_SNAPSHOT_LEFTOVER=Cannot ${action} 
${type}. The VM was running as Stateless and didn't clean up successfully. 
Please try to run the VM which should clean up the VM, and then try again when 
VM is not running.
 ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER=Cannot ${action} ${type}. The VM is 
in use by other user.
 ACTION_TYPE_FAILED_VM_NOT_FOUND=Cannot ${action} ${type}. VM is not found.
-ACTION_TYPE_FAILED_CANNOT_USE_LATEST_WITH_CLONE=Cannot ${action} ${type}. 
Cannot use 'Latest Version' when using clone from Template.
 ACTION_TYPE_FAILED_VM_NOT_SET_FOR_LATEST=Cannot ${action} ${type}. Vm is set 
to use a specific version, and not automatically update to the latest version.
 ACTION_TYPE_FAILED_VM_ALREADY_IN_LATEST_VERSION=Cannot ${action} ${type}. Vm 
is already at the latest version.
 ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE=Cannot ${action} ${type}. VM is non 
migratable.
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index 17ed988..ab7fb29 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -185,7 +185,6 @@
 ACTION_TYPE_FAILED_VM_HAS_STATELESS_SNAPSHOT_LEFTOVER=Cannot ${action} 
${type}. The VM was running as Stateless and didn't clean up successfully. 
Please try to run the VM which should clean up the VM, and then try again when 
VM is not running.
 ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER=Cannot ${action} ${type}. The VM is 
in use by other user.
 ACTION_TYPE_FAILED_VM_NOT_FOUND=Cannot ${action} ${type}. VM is not found.
-ACTION_TYPE_FAILED_CANNOT_USE_LATEST_WITH_CLONE=Cannot ${action} ${type}. 
Cannot use 'Latest Version' when using clone from Template.
 ACTION_TYPE_FAILED_VM_NOT_SET_FOR_LATEST=Cannot ${action} ${type}. Vm is set 
to use a specific version, and not automatically update to the latest version.
 ACTION_TYPE_FAILED_VM_ALREADY_IN_LATEST_VERSION=Cannot ${action} ${type}. Vm 
is already at the latest version.
 ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE=Cannot ${action} ${type}. VM is non 
migratable.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6720b4c00fc81aa16838551c60891d91c8ae703
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shmuel Leib Melamud <smela...@redhat.com>
Gerrit-Reviewer: Shmuel Melamud <smela...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to