Moti Asayag has uploaded a new change for review. Change subject: engine: Add ACTION_TYPE_FAILED prefix to vnic profile messages ......................................................................
engine: Add ACTION_TYPE_FAILED prefix to vnic profile messages Change-Id: I775864652d45db2518f73966f5edc71c7230bd9c Signed-off-by: Moti Asayag <masa...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VnicProfileValidator.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VnicProfileValidatorTest.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java M frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties 7 files changed, 39 insertions(+), 37 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/31/17731/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VnicProfileValidator.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VnicProfileValidator.java index 3600a28..a56aecd 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VnicProfileValidator.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VnicProfileValidator.java @@ -35,13 +35,13 @@ public ValidationResult vnicProfileIsSet() { return vnicProfile == null - ? new ValidationResult(VdcBllMessages.VNIC_PROFILE_NOT_EXISTS) + ? new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS) : ValidationResult.VALID; } public ValidationResult vnicProfileExists() { return getOldVnicProfile() == null - ? new ValidationResult(VdcBllMessages.VNIC_PROFILE_NOT_EXISTS) + ? new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS) : ValidationResult.VALID; } @@ -52,7 +52,7 @@ public ValidationResult vnicProfileNameNotUsed() { for (VnicProfile profile : getVnicProfiles()) { if (profile.getName().equals(vnicProfile.getName()) && !profile.getId().equals(vnicProfile.getId())) { - return new ValidationResult(VdcBllMessages.VNIC_PROFILE_NAME_IN_USE); + return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_NAME_IN_USE); } } @@ -64,7 +64,7 @@ return ValidationResult.VALID; } - return new ValidationResult(VdcBllMessages.CANNOT_CHANGE_VNIC_PROFILE_NETWORK); + return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_CHANGE_VNIC_PROFILE_NETWORK); } public ValidationResult vnicProfileNotUsedByVms() { @@ -78,7 +78,7 @@ public ValidationResult vnicProfileForVmNetworkOnly() { return getNetwork().isVmNetwork() ? ValidationResult.VALID - : new ValidationResult(VdcBllMessages.CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK); + : new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK); } protected ValidationResult vnicProfileNotUsed(List<? extends Nameable> entities, VdcBllMessages entitiesReplacement) { @@ -88,7 +88,7 @@ Collection<String> replacements = ReplacementUtils.replaceWithNameable("ENTITIES_USING_VNIC_PROFILE", entities); replacements.add(entitiesReplacement.name()); - return new ValidationResult(VdcBllMessages.VNIC_PROFILE_IN_USE, replacements); + return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_IN_USE, replacements); } public ValidationResult portMirroringNotChangedIfUsedByVms() { diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VnicProfileValidatorTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VnicProfileValidatorTest.java index ed8a9f9..22b1305 100644 --- a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VnicProfileValidatorTest.java +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VnicProfileValidatorTest.java @@ -88,7 +88,7 @@ @Test public void vnicProfileNull() throws Exception { validator = new VnicProfileValidator(null); - assertThat(validator.vnicProfileIsSet(), failsWith(VdcBllMessages.VNIC_PROFILE_NOT_EXISTS)); + assertThat(validator.vnicProfileIsSet(), failsWith(VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS)); } @Test @@ -99,7 +99,7 @@ @Test public void vnicProfileDoesNotExist() throws Exception { when(vnicProfileDao.get(any(Guid.class))).thenReturn(null); - assertThat(validator.vnicProfileExists(), failsWith(VdcBllMessages.VNIC_PROFILE_NOT_EXISTS)); + assertThat(validator.vnicProfileExists(), failsWith(VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS)); } @Test @@ -141,7 +141,7 @@ @Test public void vnicProfileNameTakenByDifferentVnicProfile() throws Exception { - vnicProfileAvailableTest(failsWith(VdcBllMessages.VNIC_PROFILE_NAME_IN_USE), + vnicProfileAvailableTest(failsWith(VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_NAME_IN_USE), getSingletonNamedVnicProfileList(DEFAULT_VNIC_PROFILE_NAME, OTHER_GUID)); } @@ -158,7 +158,7 @@ } private Matcher<ValidationResult> failsWithVnicProfileInUse() { - return failsWith(VdcBllMessages.VNIC_PROFILE_IN_USE); + return failsWith(VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_IN_USE); } @Test @@ -170,7 +170,8 @@ @Test public void changingNetworkNotAllowed() throws Exception { mockVnicProfileNetworkChange(DEFAULT_GUID, OTHER_GUID); - assertThat(validator.networkNotChanged(), failsWith(VdcBllMessages.CANNOT_CHANGE_VNIC_PROFILE_NETWORK)); + assertThat(validator.networkNotChanged(), + failsWith(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_CHANGE_VNIC_PROFILE_NETWORK)); } @Test @@ -254,7 +255,8 @@ @Test public void vnicProfileForNonVmNetwork() { - vnicProfileForVmNetworkTest(false, failsWith(VdcBllMessages.CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK)); + vnicProfileForVmNetworkTest(false, + failsWith(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK)); } private void vnicProfileForVmNetworkTest(boolean vmNetwork, Matcher<ValidationResult> matcher) { diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java index 83bc24a..639b2e6 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java @@ -428,12 +428,12 @@ NETWORK_MTU_DIFFERENCES(ErrorType.CONFLICT), NETWORK_MTU_OVERRIDE_NOT_SUPPORTED(ErrorType.CONFLICT), EXTERNAL_NETWORK_CANNOT_BE_PROVISIONED(ErrorType.NOT_SUPPORTED), - VNIC_PROFILE_NOT_EXISTS(ErrorType.BAD_PARAMETERS), - VNIC_PROFILE_NAME_IN_USE(ErrorType.CONFLICT), - VNIC_PROFILE_IN_USE(ErrorType.CONFLICT), + ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS(ErrorType.BAD_PARAMETERS), + ACTION_TYPE_FAILED_VNIC_PROFILE_NAME_IN_USE(ErrorType.CONFLICT), + ACTION_TYPE_FAILED_VNIC_PROFILE_IN_USE(ErrorType.CONFLICT), ACTION_TYPE_FAILED_CANNOT_FIND_VNIC_PROFILE_FOR_NETWORK(ErrorType.BAD_PARAMETERS), - CANNOT_CHANGE_VNIC_PROFILE_NETWORK(ErrorType.BAD_PARAMETERS), - CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK(ErrorType.BAD_PARAMETERS), + ACTION_TYPE_FAILED_CANNOT_CHANGE_VNIC_PROFILE_NETWORK(ErrorType.BAD_PARAMETERS), + ACTION_TYPE_FAILED_CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK(ErrorType.BAD_PARAMETERS), ACTION_TYPE_FAILED_MIGRATION_NETWORK_IS_NOT_SUPPORTED(ErrorType.NOT_SUPPORTED), ACTION_TYPE_FAILED_PROVIDER_DOESNT_EXIST(ErrorType.BAD_PARAMETERS), ACTION_TYPE_FAILED_MANAGEMENT_NETWORK_REQUIRED(ErrorType.BAD_PARAMETERS), diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties index 4b06d7e..238e2bc 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -359,11 +359,11 @@ VDS_GROUP_CPU_TYPE_CANNOT_BE_NULL=Cannot add Cluster. CPU type must be specified VDS_GROUP_CANNOT_DO_ACTION_NAME_IN_USE=Cannot ${action} Cluster. Cluster name is already in use. NETWORK_NAME_ALREADY_EXISTS=Cannot ${action} ${type}. Network name already exists. -VNIC_PROFILE_NOT_EXISTS=Cannot ${action} ${type}. The specified VM network interface profile doesn't exist. -VNIC_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. The VM network interface profile's name is already used by an existing profile for the same network.\n-Please choose a different name. -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. -CANNOT_CHANGE_VNIC_PROFILE_NETWORK=Cannot ${action} ${type}. VM network interface profile's network cannot be changed. -CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK=Cannot ${action} ${type}. VM network interface profiles can be added to a VM network only. +ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS=Cannot ${action} ${type}. The specified VM network interface profile doesn't exist. +ACTION_TYPE_FAILED_VNIC_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. The VM network interface profile's name is already used by an existing profile for the same network.\n-Please choose a different name. +ACTION_TYPE_FAILED_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. +ACTION_TYPE_FAILED_CANNOT_CHANGE_VNIC_PROFILE_NETWORK=Cannot ${action} ${type}. VM network interface profile's network cannot be changed. +ACTION_TYPE_FAILED_CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK=Cannot ${action} ${type}. VM network interface profiles can be added to a VM network only. ACTION_TYPE_FAILED_CANNOT_FIND_VNIC_PROFILE_FOR_NETWORK=Cannot ${action} ${type}. There is no VM network interface profile for the network the user can use.\n\- Please use a VM network interface profile instead of a network name. ACTION_TYPE_FAILED_NAME_ALREADY_USED=Cannot ${action} ${type}. The ${type} name is already in use, please choose a unique name and try again. ACTION_TYPE_FAILED_URL_INVALID=Cannot ${action} ${type}. The URL is not valid, please enter a valid URL and try again. diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java index 0029d72..b0fdbec 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java @@ -1142,19 +1142,19 @@ String NETWORK_NOT_EXISTS(); @DefaultStringValue("Cannot ${action} ${type}. The specified VM network interface profile doesn't exist.") - String VNIC_PROFILE_NOT_EXISTS(); + String ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS(); @DefaultStringValue("Cannot ${action} ${type}. The VM network interface profile's name is already used by an existing profile for the same network.\n-Please choose a different name.") - String VNIC_PROFILE_NAME_IN_USE(); + String ACTION_TYPE_FAILED_VNIC_PROFILE_NAME_IN_USE(); @DefaultStringValue("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.") - String VNIC_PROFILE_IN_USE(); + String ACTION_TYPE_FAILED_VNIC_PROFILE_IN_USE(); @DefaultStringValue("Cannot ${action} ${type}. VM network interface profile's network cannot be changed.") - String CANNOT_CHANGE_VNIC_PROFILE_NETWORK(); + String ACTION_TYPE_FAILED_CANNOT_CHANGE_VNIC_PROFILE_NETWORK(); @DefaultStringValue("Cannot ${action} ${type}. VM network interface profiles can be added to a VM network only.") - String CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK(); + String ACTION_TYPE_FAILED_CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK(); @DefaultStringValue("Cannot ${action} ${type}. There is no VM network interface profile for the network the user can use.\n- Please use a VM network interface profile instead of a network name.") String ACTION_TYPE_FAILED_CANNOT_FIND_VNIC_PROFILE_FOR_NETWORK(); diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index eecfb99..39fd7a5 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -401,11 +401,11 @@ NETWORK_INTERFACE_ALREADY_HAVE_NETWORK=The Network Interface is already attached to a Logical Network. NETWORK_ALREAY_ATTACH_TO_INTERFACE=Logical Network is already attached to a Network Interface. NETWORK_NOT_EXISTS=The specified Logical Network doesn't exist. -VNIC_PROFILE_NOT_EXISTS=Cannot ${action} ${type}. The specified VM network interface profile doesn't exist. -VNIC_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. The VM network interface profile's name is already used by an existing profile for the same network.\n-Please choose a different name. -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. -CANNOT_CHANGE_VNIC_PROFILE_NETWORK=Cannot ${action} ${type}. VM network interface profile's network cannot be changed. -CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK=Cannot ${action} ${type}. VM network interface profiles can be added to a VM network only. +ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS=Cannot ${action} ${type}. The specified VM network interface profile doesn't exist. +ACTION_TYPE_FAILED_VNIC_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. The VM network interface profile's name is already used by an existing profile for the same network.\n-Please choose a different name. +ACTION_TYPE_FAILED_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. +ACTION_TYPE_FAILED_CANNOT_CHANGE_VNIC_PROFILE_NETWORK=Cannot ${action} ${type}. VM network interface profile's network cannot be changed. +ACTION_TYPE_FAILED_CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK=Cannot ${action} ${type}. VM network interface profiles can be added to a VM network only. ACTION_TYPE_FAILED_CANNOT_FIND_VNIC_PROFILE_FOR_NETWORK=Cannot ${action} ${type}. There is no VM network interface profile for the network the user can use.\n\- Please use a VM network interface profile instead of a network name. EXTERNAL_NETWORK_CANNOT_BE_PROVISIONED=The specified external network cannot be configured on the host's interface. ERROR_CANNOT_RECOVERY_STORAGE_POOL_THERE_IS_ACTIVE_DATA_DOMAINS=Cannot recover Data Center with active Data Storage Domain in Data Center. diff --git a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index 926a748..9645fd2 100644 --- a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -363,11 +363,11 @@ VDS_GROUP_CPU_TYPE_CANNOT_BE_NULL=Cannot add Cluster. CPU type must be specified. VDS_GROUP_CANNOT_DO_ACTION_NAME_IN_USE=Cannot ${action} Cluster. Cluster name is already in use. NETWORK_NAME_ALREADY_EXISTS=Cannot ${action} ${type}. Network name already exists. -VNIC_PROFILE_NOT_EXISTS=Cannot ${action} ${type}. The specified VM network interface profile doesn't exist. -VNIC_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. The VM network interface profile's name is already used by an existing profile for the same network.\n-Please choose a different name. -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. -CANNOT_CHANGE_VNIC_PROFILE_NETWORK=Cannot ${action} ${type}. VM network interface profile's network cannot be changed. -CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK=Cannot ${action} ${type}. VM network interface profiles can be added to a VM network only. +ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS=Cannot ${action} ${type}. The specified VM network interface profile doesn't exist. +ACTION_TYPE_FAILED_VNIC_PROFILE_NAME_IN_USE=Cannot ${action} ${type}. The VM network interface profile's name is already used by an existing profile for the same network.\n-Please choose a different name. +ACTION_TYPE_FAILED_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. +ACTION_TYPE_FAILED_CANNOT_CHANGE_VNIC_PROFILE_NETWORK=Cannot ${action} ${type}. VM network interface profile's network cannot be changed. +ACTION_TYPE_FAILED_CANNOT_ADD_VNIC_PROFILE_TO_NON_VM_NETWORK=Cannot ${action} ${type}. VM network interface profiles can be added to a VM network only. ACTION_TYPE_FAILED_CANNOT_FIND_VNIC_PROFILE_FOR_NETWORK=Cannot ${action} ${type}. There is no VM network interface profile for the network the user can use.\n\- Please use a VM network interface profile instead of a network name. ACTION_TYPE_FAILED_NAME_ALREADY_USED=Cannot ${action} ${type}. The ${type} name is already in use, please choose a unique name and try again. VALIDATION_VDS_CONSOLEADDRESSS_HOSTNAME_OR_IP=Console address must be a FQDN or a valid IP address -- To view, visit http://gerrit.ovirt.org/17731 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I775864652d45db2518f73966f5edc71c7230bd9c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Moti Asayag <masa...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches