Maor Lipchuk has posted comments on this change.

Change subject: core: Add validation for locked template
......................................................................


Patch Set 4: (2 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
Line 41:     protected boolean canDoAction() {
Line 42:         boolean returnValue = false;
Line 43:         mOldTemplate = 
DbFacade.getInstance().getVmTemplateDao().get(getVmTemplate().getId());
Line 44:         VmTemplateHandler.UpdateDisksFromDb(mOldTemplate);
Line 45:         if (mOldTemplate != null) {
This command is only for updating template properties, In which scenarios 
locked disks should block it?
Line 46:             if (mOldTemplate.getstatus() == VmTemplateStatus.Locked) {
Line 47:                 return 
failCanDoAction(VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED);
Line 48:             }
Line 49:             if 
(VmTemplateHandler.BlankVmTemplateId.equals(mOldTemplate.getId())) {


Line 89:     @Override
Line 90:     protected void executeCommand() {
Line 91:         if (getVmTemplate() != null) {
Line 92:             UpdateVmTemplate();
Line 93:             if (getVmTemplate().getstorage_pool_id() != null
Liron also mentioned, persisting the lock status in the DB. It is in the patch 
comments.
Will consider
Line 94:                     && 
!VmTemplateHandler.BlankVmTemplateId.equals(getVmTemplate().getId())) {
Line 95:                 UpdateTemplateInSpm(
Line 96:                         
getVmTemplate().getstorage_pool_id().getValue(),
Line 97:                         new 
java.util.ArrayList<VmTemplate>(java.util.Arrays


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If4e25d5e9badd3169b2b5a65c3a7e745adadf379
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Asaf Shakarchi <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to