Arik Hadas has posted comments on this change. Change subject: core: Re-extract validation to be used at the parent command. ......................................................................
Patch Set 1: (2 comments) @Maor - ack, this is needed indeed :) http://gerrit.ovirt.org/#/c/28515/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmFromConfigurationCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmFromConfigurationCommand.java: Line 42: protected boolean canDoAction() { Line 43: if (isImagesAlreadyOnTarget() && !validateImagesOnStorage(vmFromConfiguration, ovfEntityData)) { Line 44: return false; Line 45: } Line 46: return super.canDoAction(); if you're refactoring this method.. I think it will be better to call the super.canDoAction first and then do the rest of the validations (let's say the template is null - the user will may get storage-related error instead of getting the basic one about the null template), what do you think? Line 47: } Line 48: Line 49: @Override Line 50: protected void init(T parameters) { http://gerrit.ovirt.org/#/c/28515/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java: Line 150: Line 151: protected boolean validateImagesOnStorage(IVdcQueryable entityFromConfiguration, OvfEntityData ovfEntityData) { Line 152: if (ovfEntityData == null && !getParameters().isImportAsNewEntity()) { Line 153: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_UNSUPPORTED_OVF); Line 154: return false; can you replace this one and the one below with "return failCanDo.." ? Line 155: } Line 156: if (entityFromConfiguration == null) { Line 157: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_OVF_CONFIGURATION_NOT_SUPPORTED); Line 158: return false; -- To view, visit http://gerrit.ovirt.org/28515 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic25f6f086fe3a8a55de33529a6fb92728d3e0d74 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Arik Hadas <[email protected]> Gerrit-Reviewer: Daniel Erez <[email protected]> Gerrit-Reviewer: Liron Ar <[email protected]> Gerrit-Reviewer: Maor Lipchuk <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
