Allon Mureinik has uploaded a new change for review.

Change subject: core: VmPoolCommandBase preview validation
......................................................................

core: VmPoolCommandBase preview validation

In VmPoolCommandBase, moved the validation that the VM is not
in preview from ImagesHandler to SnapshotValidator, which is a more
logical place for it.

Note: This patch is part of a series of patches aimed at removing the
preview validation from ImagesHandler altogether.

Change-Id: I483bd9bbadbbadb6678b0b0c60fabfdf8c9f0b14
Signed-off-by: Allon Mureinik <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/86/11186/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
index 50ab2b4..bed879d 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
@@ -187,10 +187,14 @@
 
         // check vm images:
         else {
-            ValidationResult vmDuringSnapshotResult =
-                    new SnapshotsValidator().vmNotDuringSnapshot(vmId);
+            SnapshotsValidator snapshotsValidator = new SnapshotsValidator();
+            ValidationResult vmDuringSnapshotResult = 
snapshotsValidator.vmNotDuringSnapshot(vmId);
+            ValidationResult vmInPreviewResult = 
snapshotsValidator.vmNotInPreview(vmId);
             if (!vmDuringSnapshotResult.isValid()) {
                 messages.add(vmDuringSnapshotResult.getMessage().name());
+                returnValue = false;
+            } else if (!vmInPreviewResult.isValid()) {
+                messages.add(vmInPreviewResult.getMessage().name());
                 returnValue = false;
             } else {
                 List<Disk> disks = 
DbFacade.getInstance().getDiskDao().getAllForVm(vmId);
@@ -206,7 +210,7 @@
                                 true,
                                 false,
                                 false,
-                                true,
+                                false,
                                 !Guid.Empty.equals(storageDomainId),
                                 true,
                                 disks);


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

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

Reply via email to