Moti Asayag has posted comments on this change. Change subject: engine: Introduce VnicProfileValidator ......................................................................
Patch Set 22: (5 comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/UpdateVnicProfileCommand.java Line 18: protected boolean canDoAction() { Line 19: VnicProfileValidator validator = new VnicProfileValidator(getVnicProfile()); Line 20: return validate(validator.vnicProfileIsSet()) Line 21: && validate(validator.vnicProfileExists()) Line 22: && validate(validator.networkExists()) Done Line 23: && validate(validator.vnicProfileNameNotUsed()) Line 24: && validate(validator.networkNotChanged()); Line 25: } Line 26: .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VnicProfileValidator.java Line 40: ? new ValidationResult(VdcBllMessages.VNIC_PROFILE_NOT_EXISTS) Line 41: : ValidationResult.VALID; Line 42: } Line 43: Line 44: public ValidationResult networkExists() { will reuse NetworkValidator.networkIsSet() Line 45: return getNetwork() == null Line 46: ? new ValidationResult(VdcBllMessages.NETWORK_NOT_EXISTS) Line 47: : ValidationResult.VALID; Line 48: } Line 109: } Line 110: Line 111: protected List<VM> getVmsUsingProfile() { Line 112: if (vms == null) { Line 113: vms = getDbFacade().getVmDao().getAllForVnicProfile(vnicProfile.getId()); it is being reused for verifying portMirroringNotChangedIfUsedByVms which will be introduced in few patches latter. Line 114: } Line 115: Line 116: return vms; Line 117: } .................................................... File backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties Line 358: -Please upgrade your Cluster to a later Compatibility version first. Line 359: VDS_GROUP_CPU_TYPE_CANNOT_BE_NULL=Cannot add Cluster. CPU type must be specified Line 360: VDS_GROUP_CANNOT_DO_ACTION_NAME_IN_USE=Cannot ${action} Cluster. Cluster name is already in use. Line 361: NETWORK_NAME_ALREADY_EXISTS=Cannot ${action} ${type}. Network name already exists. Line 362: VNIC_PROFILE_NOT_EXISTS=The specified VM network interface profile doesn't exist. Done Line 363: VNIC_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. The VM network interface profile's name is already used by an existing profile in the same data-center.\n-Please choose a different name. Line 364: VNIC_PROFILE_IN_USE=Cannot ${action} ${type}. Several ${entities} (${ENTITIES_USING_VNIC_PROFILE_COUNTER}) are using this VM network interface profile:\n${ENTITIES_USING_VNIC_PROFILE}\n - Please remove it from all ${entities} that are using it and try again. Line 365: CANNOT_CHANGE_VNIC_PROFILE_NETWORK=Cannot ${action} ${type}. VM network interface profile's network cannot be changed. Line 366: ACTION_TYPE_FAILED_NAME_ALREADY_USED=Cannot ${action} ${type}. The ${type} name is already in use, please choose a unique name and try again. Line 359: VDS_GROUP_CPU_TYPE_CANNOT_BE_NULL=Cannot add Cluster. CPU type must be specified Line 360: VDS_GROUP_CANNOT_DO_ACTION_NAME_IN_USE=Cannot ${action} Cluster. Cluster name is already in use. Line 361: NETWORK_NAME_ALREADY_EXISTS=Cannot ${action} ${type}. Network name already exists. Line 362: VNIC_PROFILE_NOT_EXISTS=The specified VM network interface profile doesn't exist. Line 363: VNIC_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. The VM network interface profile's name is already used by an existing profile in the same data-center.\n-Please choose a different name. i'll do it as a new patch, on top of the existing ones. Line 364: VNIC_PROFILE_IN_USE=Cannot ${action} ${type}. Several ${entities} (${ENTITIES_USING_VNIC_PROFILE_COUNTER}) are using this VM network interface profile:\n${ENTITIES_USING_VNIC_PROFILE}\n - Please remove it from all ${entities} that are using it and try again. Line 365: CANNOT_CHANGE_VNIC_PROFILE_NETWORK=Cannot ${action} ${type}. VM network interface profile's network cannot be changed. Line 366: ACTION_TYPE_FAILED_NAME_ALREADY_USED=Cannot ${action} ${type}. The ${type} name is already in use, please choose a unique name and try again. Line 367: ACTION_TYPE_FAILED_URL_INVALID=Cannot ${action} ${type}. The URL is not valid, please enter a valid URL and try again. -- To view, visit http://gerrit.ovirt.org/16887 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6af74a398d1d7ffb97a1802305c56ad536acb346 Gerrit-PatchSet: 22 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> 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