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: Id20106788bdd8a2b0f3008159c4b44dbbfaa443b
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/47/40847/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 ece031f..35f8d2c 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -1169,7 +1169,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 667bfd3..7f7a53c 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
@@ -3153,7 +3153,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 cbe11ed..28d9c5b 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 8a761d7..a02ba64 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
@@ -1138,7 +1138,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/40847
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id20106788bdd8a2b0f3008159c4b44dbbfaa443b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Dudi Maroshi <d...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to