Tomas Jelinek has posted comments on this change.

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


Patch Set 16:

(8 comments)

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

Line 90:     }
Line 91: 
Line 92:     protected ValidationResult validateModelCompatibleWithOs() {
Line 93:         VmWatchdogValidator validator = getVmWatchdogValidator();
Line 94:         if (validator != null) {
> much more readable and simple to add at line 58 a simple check
but in that case that logic would be inherited also by RemoveWatchdogCommand 
and it should not...
Line 95:             return validator.isModelCompatibleWithOs();
Line 96:         } else {
Line 97:             return new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY);
Line 98:         }


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

Line 336:     @Override
Line 337:     protected boolean canDoAction() {
Line 338:         boolean isInstanceType = getParameters().getTemplateType() == 
VmEntityType.INSTANCE_TYPE;
Line 339:         if (getVdsGroup() == null && !isInstanceType) {
Line 340:             
addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID);
> a nift - can you change here to return failCanDoAction...
Done
Line 341:             return false;
Line 342:         }
Line 343: 
Line 344:         if 
(!isVmPriorityValueLegal(getParameters().getMasterVm().getPriority(), 
getReturnValue()


Line 346:             return false;
Line 347:         }
Line 348: 
Line 349:         if (isVmInDb && getVm().getStatus() != VMStatus.Down) {
Line 350:             
addCanDoActionMessage(VdcBllMessages.VMT_CANNOT_CREATE_TEMPLATE_FROM_DOWN_VM.toString());
> and here
Done
Line 351:             return false;
Line 352:         }
Line 353: 
Line 354:         if (isVmTemlateWithSameNameExist(getVmTemplateName())) {


Line 352:         }
Line 353: 
Line 354:         if (isVmTemlateWithSameNameExist(getVmTemplateName())) {
Line 355:             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED);
Line 356:             return false;
> and here
Done
Line 357:         }
Line 358: 
Line 359:         if (getParameters().getBaseTemplateId() != null) {
Line 360:             VmTemplate userSelectedBaseTemplate = 
getVmTemplateDAO().get(getParameters().getBaseTemplateId());


Line 366: 
Line 367:             }
Line 368:         }
Line 369: 
Line 370:         if (!isInstanceType) {
> ;-) instance types got your happiness and positiveness out.. 
sure, instance types are the clowns of oVirt :)
Line 371:             return doClusterRelatedChecks();
Line 372:         } else {
Line 373:             return true;
Line 374:         }


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

Line 33:     }
Line 34: 
Line 35:     @Override
Line 36:     protected boolean canDoAction() {
Line 37:         if (!super.canDoAction()) {
> i dont understand why this is needed, we know the cluster(vds group) of the
Done
Line 38:             return false;
Line 39:         }
Line 40: 
Line 41:         if (getVm() == null) {


http://gerrit.ovirt.org/#/c/23828/16/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 95:         if (!super.canDoAction()) {
Line 96:             return false;
Line 97:         }
Line 98: 
Line 99:         if (getVdsGroup() == null && getVmTemplate().getTemplateType() 
!= VmEntityType.INSTANCE_TYPE) {
> don't think cluster is ever being used in that command.
this has been removed in some more recent patch set
Line 100:             
addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID);
Line 101:             return false;
Line 102:         }
Line 103: 


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

Line 487:     @Override
Line 488:     protected boolean canDoAction() {
Line 489:         if (getVdsGroup() == null) {
Line 490:             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY);
Line 491:             return false;
> please use failCanDoAction method, its nicer
it has been removed in some more recent patch set
Line 492:         }
Line 493: 
Line 494:         return super.canDoAction();
Line 495:     }


-- 
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: 16
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