Tomas Jelinek has posted comments on this change.

Change subject: core: adjustments needed to support instance types
......................................................................


Patch Set 20:

(6 comments)

http://gerrit.ovirt.org/#/c/23828/20/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveAllVmTemplateImageTemplatesCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveAllVmTemplateImageTemplatesCommand.java:

Line 90:         setSucceeded(true);
Line 91:     }
Line 92: 
Line 93:     @Override
Line 94:     protected boolean canDoAction() {
> any reason to check cluster on images remove?
well, no reason. Removed
Line 95:         if (getVdsGroup() == null && getVmTemplate().getTemplateType() 
!= VmEntityType.INSTANCE_TYPE) {
Line 96:             
addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID);
Line 97:             return false;
Line 98:         }


http://gerrit.ovirt.org/#/c/23828/20/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmTemplateCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmTemplateCommand.java:

Line 258: 
Line 259:     protected boolean removeVmTemplateImages() {
Line 260:         if (getVmTemplate().getTemplateType() == 
VmEntityType.INSTANCE_TYPE) {
Line 261:             return true;
Line 262:         }
> if you remove the canDoAction check in the previous file,
Done
Line 263: 
Line 264:         
getParameters().setEntityInfo(getParameters().getEntityInfo());
Line 265:         getParameters().setParentCommand(getActionType());
Line 266:         getParameters().setParentParameters(getParameters());


http://gerrit.ovirt.org/#/c/23828/20/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmTemplateFromImportExportCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmTemplateFromImportExportCommand.java:

Line 46:     }
Line 47: 
Line 48:     @Override
Line 49:     protected boolean canDoAction() {
Line 50:         boolean isInstanceType = getVmTemplate().getTemplateType() != 
VmEntityType.INSTANCE_TYPE;
> not sure this is correct for removing template from export domain, you were
indeed the check was not correct. Now it is ok and I have verified it works.
Line 51: 
Line 52:         if (getVdsGroup() == null && isInstanceType) {
Line 53:             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY);
Line 54:             return false;


http://gerrit.ovirt.org/#/c/23828/20/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java:

Line 54: 
Line 55:     @Override
Line 56:     protected boolean canDoAction() {
Line 57:         boolean isInstanceType = getVmTemplate().getTemplateType() == 
VmEntityType.INSTANCE_TYPE;
Line 58:         if (getVdsGroup() == null && getVmTemplate().getTemplateType() 
!= VmEntityType.INSTANCE_TYPE) {
> why not use the isInstanceType variable above? :)
:-)
Line 59:             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY);
Line 60:             return false;
Line 61:         }
Line 62: 


Line 87:             }
Line 88:         }
Line 89: 
Line 90:         // Check that the USB policy is legal
Line 91:         if (returnValue && !isInstanceType) {
> maybe you can do like in add-template, unify all cluster-related checks int
Done
Line 92:             returnValue = 
VmHandler.isUsbPolicyLegal(getParameters().getVmTemplateData().getUsbPolicy(), 
getParameters().getVmTemplateData().getOsId(), getVdsGroup(), 
getReturnValue().getCanDoActionMessages());
Line 93:         }
Line 94: 
Line 95:         // Check if the OS type is supported


Line 311:     @Override
Line 312:     public List<PermissionSubject> getPermissionCheckSubjects() {
Line 313:         final List<PermissionSubject> permissionList = 
super.getPermissionCheckSubjects();
Line 314: 
Line 315:         if (getVmTemplate() != null && 
getVmTemplate().getTemplateType() != VmEntityType.INSTANCE_TYPE) {
> but what about permissions for updating instance types?
All relevant are inherited from the parent. There is nothing host-specific for 
instance type so no need to check for them. And there is no instance type 
specific permission to specifically add here.
Line 316:             // host-specific parameters can be changed by 
administration role only
Line 317:             if (!(getVmTemplate().getDedicatedVmForVds() == null ?
Line 318:                     
getParameters().getVmTemplateData().getDedicatedVmForVds() == null :
Line 319:                     
getVmTemplate().getDedicatedVmForVds().equals(getParameters().getVmTemplateData()


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifaebd849061efa1637f9fa21d8584212ba0e51f2
Gerrit-PatchSet: 20
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to