Liron Aravot has uploaded a new change for review.

Change subject: core: make message ovf store specific
......................................................................

core: make message ovf store specific

Changed ACTION_TYPE_FAILED__DISK_NOT_IN_APPLICABLE_STATUS to be specific
to OVF disks to make it clearer.

Change-Id: Ie29c226f76839863008b25c69d4923c9685b17f7
Bug-Url: https://bugzilla.redhat.com/1114431
Signed-off-by: Liron Aravot <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/DiskImagesValidator.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveDiskCommandTest.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
8 files changed, 12 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/64/30564/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskCommand.java
index 2f92504..9f8016a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskCommand.java
@@ -119,7 +119,9 @@
         DiskImage diskImage = getDiskImage();
         DiskImagesValidator diskImagesValidator = new 
DiskImagesValidator(Collections.singletonList(diskImage));
 
-        if (diskImage.isOvfStore() && 
!validate(diskImagesValidator.disksInStatus(ImageStatus.ILLEGAL))) {
+        if (diskImage.isOvfStore()
+                && 
!validate(diskImagesValidator.disksInStatus(ImageStatus.ILLEGAL,
+                        
VdcBllMessages.ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS))) {
             return false;
         }
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/DiskImagesValidator.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/DiskImagesValidator.java
index 80b30e3..c0dc06a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/DiskImagesValidator.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/DiskImagesValidator.java
@@ -229,10 +229,10 @@
         return result;
     }
 
-    public ValidationResult disksInStatus(ImageStatus applicableStatus) {
+    public ValidationResult disksInStatus(ImageStatus applicableStatus, 
VdcBllMessages message) {
         for (DiskImage diskImage : diskImages) {
             if (diskImage.getImageStatus() != applicableStatus) {
-                return new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS,
+                return new ValidationResult(message,
                         String.format("$status %s", applicableStatus.name()));
             }
         }
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveDiskCommandTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveDiskCommandTest.java
index fa7f368..e5bd2fc 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveDiskCommandTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveDiskCommandTest.java
@@ -98,6 +98,6 @@
         disk.setImageStatus(ImageStatus.OK);
         disk.setOvfStore(true);
         CanDoActionTestUtils.runAndAssertCanDoActionFailure(cmd,
-                
VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS);
+                
VdcBllMessages.ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS);
     }
 }
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 87eea68..85c375b 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
@@ -678,7 +678,7 @@
     VDS_CANNOT_MAINTENANCE_IT_INCLUDES_NON_MIGRATABLE_VM(ErrorType.CONFLICT),
     VDS_CANNOT_MAINTENANCE_VM_HAS_PLUGGED_DISK_SNAPSHOT(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED(ErrorType.CONFLICT),
-    ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS(ErrorType.CONFLICT),
+    ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS(ErrorType.CONFLICT),
     
ACTION_TYPE_FAILED_DISKS_SNAPSHOTS_DONT_BELONG_TO_SAME_DISK(ErrorType.CONFLICT),
     
ACTION_TYPE_FAILED_VM_CANNOT_BE_HIGHLY_AVAILABLE_AND_PINNED_TO_HOST(ErrorType.CONFLICT),
     
ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_AND_MIGRATABLE(ErrorType.CONFLICT),
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 23ed859..1aea41d 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -85,7 +85,7 @@
  ${disksInfo} \n \n\
 please deactivate/detach the Disk snapshots or turn off those VMs and try 
again.
 ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED=Cannot ${action} ${type}. The 
operation is currently not supported for disks used as OVF store.
-ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS=Cannot ${action} ${type}. The 
operation can be performed only for disks that are in ${status} status.
+ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS=Cannot ${action} ${type}. 
The operation can be performed only for OVF disks that are in ${status} status.
 VDS_CANNOT_REMOVE_DEFAULT_VDS_GROUP=Cannot remove default Host Cluster.
 VDS_CANNOT_REMOVE_VDS_DETECTED_RUNNING_VM=Cannot ${action} ${type}. One or 
more VMs are still running on this Host. 
 VDS_CANNOT_REMOVE_VDS_GROUP_VDS_DETECTED=Cannot ${action} ${type}. Host 
Cluster contains one or more Hosts.
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 877d341..db93ce4 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
@@ -202,8 +202,8 @@
     @DefaultStringValue("Cannot ${action} ${type}. There is no OVF for the 
specific entity.")
     String ACTION_TYPE_FAILED_UNSUPPORTED_OVF();
 
-    @DefaultStringValue("Cannot ${action} ${type}. The operation can be 
performed only for disks that are in ${status} status.")
-    String ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS();
+    @DefaultStringValue("Cannot ${action} ${type}. The operation can be 
performed only for OVF disks that are in ${status} status.")
+    String ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS();
 
     @DefaultStringValue("Cannot remove default Host Cluster.")
     String VDS_CANNOT_REMOVE_DEFAULT_VDS_GROUP();
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 c238683..856bf02 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
@@ -82,7 +82,7 @@
 One or more running VMs are indicated as non-migratable. The non-migratable 
VMs are: ${VmsList}.
 VDS_CANNOT_MAINTENANCE_VM_HAS_PLUGGED_DISK_SNAPSHOT=Cannot switch the 
following Hosts to Maintenance mode: ${HostsList}.\nThe following VMs cannot be 
migrated because they have activated Disk Snapshot attached (VM/Disk 
Snapshots):\n\n${disksInfo}\n\nplease deactivate/detach the Disk snapshots or 
turn off those VMs and try again.
 ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED=Cannot ${action} ${type}. The 
operation is currently not supported for disks used as OVF store.
-ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS=Cannot ${action} ${type}. The 
operation can be performed only for disks that are in ${status} status.
+ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS=Cannot ${action} ${type}. 
The operation can be performed only for OVF disks that are in ${status} status.
 VDS_CANNOT_REMOVE_DEFAULT_VDS_GROUP=Cannot remove default Host Cluster.
 VDS_CANNOT_REMOVE_VDS_DETECTED_RUNNING_VM=Cannot ${action} ${type}. One or 
more VMs are still running on this Host. 
 VDS_CANNOT_REMOVE_VDS_GROUP_VDS_DETECTED=Cannot ${action} ${type}. Host 
Cluster contains one or more Hosts.
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 b9cd65c..395e1df 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
@@ -85,7 +85,7 @@
  ${disksInfo} \n \n\
 please deactivate/detach the Disk snapshots or turn off those VMs and try 
again.
 ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED=Cannot ${action} ${type}. The 
operation is currently not supported for disks used as OVF store.
-ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS=Cannot ${action} ${type}. The 
operation can be performed only for disks that are in ${status} status.
+ACTION_TYPE_FAILED_OVF_DISK_NOT_IN_APPLICABLE_STATUS=Cannot ${action} ${type}. 
The operation can be performed only for OVF disks that are in ${status} status.
 VDS_CANNOT_REMOVE_DEFAULT_VDS_GROUP=Cannot remove default Host Cluster.
 VDS_CANNOT_REMOVE_VDS_DETECTED_RUNNING_VM=Cannot ${action} ${type}. One or 
more VMs are still running on this Host. 
 VDS_CANNOT_REMOVE_VDS_GROUP_VDS_DETECTED=Cannot ${action} ${type}. Host 
Cluster contains one or more Hosts.


-- 
To view, visit http://gerrit.ovirt.org/30564
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie29c226f76839863008b25c69d4923c9685b17f7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Liron Aravot <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to