Alissa Bonas has posted comments on this change.
Change subject: core: block MoveDisks on snapshot preview
......................................................................
Patch Set 1: (1 inline comment)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveDisksCommand.java
Line 97: VM vm = !allVms.isEmpty() ? allVms.get(0) : null;
Line 98: SnapshotsValidator snapshotsValidator = new
SnapshotsValidator();
Line 99:
Line 100: if (vm != null &&
!validate(snapshotsValidator.vmNotInPreview(vm.getId()))) {
Line 101: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW);
the "vmNotInPreview" method already has the error message VM_IN_PREVIEW, and
the "validate" method used here already adds the error message from validation
to the error messages of the command, so no need to add it here as well by
using "failCanDoAction".
Basically, instead of "failCanDoAction" it's better just to "return false".
Line 102: }
Line 103: else if (vm == null || isVmDown(vm)) {
Line 104: moveParametersList.add(moveDiskParameters);
Line 105: }
--
To view, visit http://gerrit.ovirt.org/11340
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib3b93d08eaadb230fe2cc985a9ba57efb5dd3abb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches