Dudi Maroshi has uploaded a new change for review. Change subject: engine: Fix ambigous error message ......................................................................
engine: Fix ambigous error message Fix error message to reflect the subject DiskProfile name and the target StorageDomain name. Sample fixed error message: Operation Failed: [Cannot add VM. Disk Profile 'storage-profile-1-ds-2' is not assigned to Storage Domain 'storage-domain-2'.] Change-Id: I445fd9943f4db734e3234fb90fe937975682d038 Bug-Url: https://bugzilla.redhat.com/1220127 Signed-off-by: Dudi Maroshi <d...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/DiskProfileValidator.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 5 files changed, 9 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/03/40803/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/DiskProfileValidator.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/DiskProfileValidator.java index 1fc02ef..744b73a 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/DiskProfileValidator.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/DiskProfileValidator.java @@ -59,7 +59,11 @@ return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_PROFILE_NOT_FOUND); } if (!storageDomainId.equals(fetchedDiskProfile.getStorageDomainId())) { - return new ValidationResult(VdcBllMessages.ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN); + String diskProfileName = fetchedDiskProfile.getName(); + String targetStorageDomainName = getStorageDomain().getName(); + return new ValidationResult(VdcBllMessages.ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN, + String.format("$diskProfile %s", diskProfileName), + String.format("$storageDomain %s", targetStorageDomainName)); } return ValidationResult.VALID; } 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 bbffa8b..98eb5fc 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -1167,7 +1167,7 @@ ACTION_TYPE_DISK_PROFILE_EMPTY=Cannot ${action} ${type}. Disk Profile is empty. ACTION_TYPE_FAILED_DISK_PROFILE_NOT_FOUND=Cannot ${action} ${type}. Disk Profile wasn't found. ACTION_TYPE_DISK_PROFILE_STORAGE_DOMAIN_NOT_PROVIDED=Cannot ${action} ${type}. Storage Domain wasn't provided. -ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN=Cannot ${action} ${type}. Disk Profile doesn't match provided Storage Domain. +ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN=Cannot ${action} ${type}. Disk Profile '${diskProfile}' is not assigned to Storage Domain '${storageDomain}'. ACTION_TYPE_CPU_PROFILE_NOT_MATCH_CLUSTER=Cannot ${action} ${type}. CPU Profile doesn't match provided Cluster. ACTION_TYPE_CANNOT_REMOVE_LAST_CPU_PROFILE_IN_CLUSTER=Cannot ${action} ${type}. Cannot remove last CPU profile in Cluster. ACTION_TYPE_CANNOT_REMOVE_LAST_DISK_PROFILE_IN_STORAGE_DOMAIN=Cannot ${action} ${type}. Cannot remove last Disk profile in Storage Domain. 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 b34e6aa..0725e90 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 @@ -3150,7 +3150,7 @@ @DefaultStringValue("Cannot ${action} ${type}. Storage Domain wasn't provided.") String ACTION_TYPE_DISK_PROFILE_STORAGE_DOMAIN_NOT_PROVIDED(); - @DefaultStringValue("Cannot ${action} ${type}. Disk Profile doesn't match provided Storage Domain.") + @DefaultStringValue("Cannot ${action} ${type}. Disk Profile '${diskProfile}' is not assigned to Storage Domain '${storageDomain}'.") String ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN(); @DefaultStringValue("Cannot ${action} ${type}. CPU Profile doesn't match provided Cluster.") 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 55dfd79..f09297e 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 @@ -1069,4 +1069,5 @@ BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH=Cannot ${action} ${type}. Balloon is not supported on '${clusterArch}' architecture. USER_NOT_AUTHORIZED_TO_ATTACH_DISK_PROFILE=Cannot ${action} ${type}. The user doesn't have permissions to attach Disk Profile to the Disk. +ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN=Cannot ${action} ${type}. Disk Profile '${diskProfile}' is not assigned to Storage Domain '${storageDomain}'. 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 65cf3f6..b0b5c18 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 @@ -1136,7 +1136,7 @@ ACTION_TYPE_DISK_PROFILE_EMPTY=Cannot ${action} ${type}. Disk Profile is empty. ACTION_TYPE_FAILED_DISK_PROFILE_NOT_FOUND=Cannot ${action} ${type}. Disk Profile wasn't found. ACTION_TYPE_DISK_PROFILE_STORAGE_DOMAIN_NOT_PROVIDED=Cannot ${action} ${type}. Storage Domain wasn't provided. -ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN=Cannot ${action} ${type}. Disk Profile doesn't match provided Storage Domain. +ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN=Cannot ${action} ${type}. Disk Profile '${diskProfile}' is not assigned to Storage Domain '${storageDomain}'. ACTION_TYPE_CPU_PROFILE_NOT_MATCH_CLUSTER=Cannot ${action} ${type}. CPU Profile doesn't match provided Cluster. ACTION_TYPE_CANNOT_REMOVE_LAST_CPU_PROFILE_IN_CLUSTER=Cannot ${action} ${type}. Cannot remove last CPU profile in Cluster. ACTION_TYPE_CANNOT_REMOVE_LAST_DISK_PROFILE_IN_STORAGE_DOMAIN=Cannot ${action} ${type}. Cannot remove last Disk profile in Storage Domain. -- To view, visit https://gerrit.ovirt.org/40803 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I445fd9943f4db734e3234fb90fe937975682d038 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Dudi Maroshi <d...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches