Tomer Saban has uploaded a new change for review.

Change subject: webadmin: Added cluster policy attached error
......................................................................

webadmin: Added cluster policy attached error

Added a new cluster policy attached to cluster error message that
better describes the situation when a user tries to remove a cluster
policy which is being used by a cluster.

(The old message said "Invalid parameters" which doesn't explain to
the user what exactly is the problem).

Change-Id: I4ce89d69e2f60c4ca6c88dd860a1910fcb693ee8
Bug-Url: https://bugzilla.redhat.com/1118503
Signed-off-by: Tomer Saban <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/commands/RemoveClusterPolicyCommand.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/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
5 files changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/51/39451/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/commands/RemoveClusterPolicyCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/commands/RemoveClusterPolicyCommand.java
index 2051544..2158666 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/commands/RemoveClusterPolicyCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/commands/RemoveClusterPolicyCommand.java
@@ -17,7 +17,7 @@
             return false;
         }
         if 
(SchedulingManager.getInstance().getClustersByClusterPolicyId(getParameters().getClusterPolicyId()).size()
 > 0) {
-            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID);
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_ATTACHED_TO_CLUSTER);
         }
         return true;
     }
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 39ace55..27c2974 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
@@ -788,6 +788,7 @@
     ACTION_TYPE_FAILED_VDS_HA_NOT_CONFIGURED(ErrorType.BAD_PARAMETERS),
     // Cluster Policy messages
     
ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID(ErrorType.BAD_PARAMETERS),
+    ACTION_TYPE_FAILED_CLUSTER_POLICY_ATTACHED_TO_CLUSTER(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_CLUSTER_POLICY_NAME_INUSE(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_CLUSTER_POLICY_LOCKED(ErrorType.BAD_PARAMETERS),
     ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE(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 b4470db..4125e95 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -1090,6 +1090,7 @@
 
 # cluster policy errors
 ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID=Cannot ${action} ${type}. 
Parameters are invalid.
+ACTION_TYPE_FAILED_CLUSTER_POLICY_ATTACHED_TO_CLUSTER=Cannot ${action} 
${type}. Cluster policy still attached to cluster. Ensure the cluster policy 
has been removed from all clusters and retry.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_NAME_INUSE=Cannot ${action} ${type}. Name is 
in use.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_LOCKED=Cannot ${action} ${type}. Cluster 
Policy is locked, and cannot be editable.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE=Cannot ${action} ${type}. Cluster 
Policy is attached to cluster(s), please assign these cluster(s) to other 
policy.
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 b4bf4b2..85cac2b 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
@@ -2967,6 +2967,9 @@
     @DefaultStringValue("Cannot ${action} ${type}. Parameters are invalid.")
     String ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID();
 
+    @DefaultStringValue("Cannot ${action} ${type}. Cluster policy still 
attached to cluster. Ensure the cluster policy has been removed from all 
clusters and retry.")
+    String ACTION_TYPE_FAILED_CLUSTER_POLICY_ATTACHED_TO_CLUSTER();
+
     @DefaultStringValue("Cannot ${action} ${type}. Name is in use.")
     String ACTION_TYPE_FAILED_CLUSTER_POLICY_NAME_INUSE();
 
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 7dfe4a3..bf27c7a 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
@@ -1068,6 +1068,7 @@
 
 # cluster policy errors
 ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID=Cannot ${action} ${type}. 
Parameters are invalid.
+ACTION_TYPE_FAILED_CLUSTER_POLICY_ATTACHED_TO_CLUSTER=Cannot ${action} 
${type}. Cluster policy still attached to cluster. Ensure the cluster policy 
has been removed from all clusters and retry.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_NAME_INUSE=Cannot ${action} ${type}. Name is 
in use.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_LOCKED=Cannot ${action} ${type}. Cluster 
Policy is locked, and cannot be editable.
 ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE=Cannot ${action} ${type}. Cluster 
Policy is attached to cluster(s), please assign these cluster(s) to other 
policy.


-- 
To view, visit https://gerrit.ovirt.org/39451
To unsubscribe, visit https://gerrit.ovirt.org/settings

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

Reply via email to