Karnan t c has uploaded a new change for review.

Change subject: engine:fail stop volume if remove brick is running
......................................................................

engine:fail stop volume if remove brick is running

'stop' gluster volume is not allowed if there is a remove brick operation
is running on that volume

With multiple paragraphs if necessary.

Change-Id: Ic7f227b086e78374b385ebd2f4d8f8591825c7fe
Bug-Url: https://bugzilla.redhat.com/1032020
Signed-off-by: Karnan TC <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.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, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/72/28472/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
index 748e475..4d470f7 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
@@ -52,6 +52,11 @@
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REBALANCE_IN_PROGRESS);
         }
 
+        if (getGlusterTaskUtils().isTaskOfType(volume, 
GlusterTaskType.REMOVE_BRICK)
+                && getGlusterTaskUtils().isTaskStatus(volume, 
JobExecutionStatus.STARTED)) {
+            return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REMOVE_BRICK_IN_PROGRESS);
+        }
+
         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 2638e86..8ee5b82 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
@@ -848,6 +848,7 @@
     
ACTION_TYPE_FAILED_GLUSTER_VOLUME_DISTRIBUTED_AND_HAS_SINGLE_BRICK(ErrorType.BAD_PARAMETERS),
     
ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED(ErrorType.CONFLICT),
     
ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REBALANCE_IN_PROGRESS(ErrorType.CONFLICT),
+    
ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REMOVE_BRICK_IN_PROGRESS(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_NOT_A_GLUSTER_VOLUME_BRICK(ErrorType.BAD_PARAMETERS),
     
ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_STARTED(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 3475f8e..b3d218a 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -1092,6 +1092,7 @@
 ACTION_TYPE_FAILED_VOLUME_OPERATION_IN_PROGRESS=Cannot ${action} ${type}. A 
task is in progress on the volume ${volumeName} in cluster ${vdsGroup}.
 ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED=Cannot ${action} 
${type}. Rebalance is not running on the volume ${volumeName} in cluster 
${vdsGroup}.
 ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REBALANCE_IN_PROGRESS= Cannot 
${action} ${type}. Rebalance is running on the volume ${volumeName} in cluster 
${vdsGroup}.
+ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REMOVE_BRICK_IN_PROGRESS= Cannot 
${action} ${type}. Remove brick operation is already running on the volume 
${volumeName} in cluster ${vdsGroup}.
 ACTION_TYPE_FAILED_GLUSTER_OPERATION_INPROGRESS=Cannot ${action} ${type}. 
Gluster operation is in progress in cluster. Please try again.
 ACTION_TYPE_FAILED_TAG_ID_REQUIRED=Cannot ${action} ${type}. Tag ID is 
required.
 
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 98ac5ea..d99fcee 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
@@ -2877,6 +2877,9 @@
     @DefaultStringValue("Cannot ${action} ${type}. Rebalance is running on the 
volume ${volumeName} in cluster ${vdsGroup}.")
     String 
ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REBALANCE_IN_PROGRESS();
 
+    @DefaultStringValue("Cannot ${action} ${type}. Remove brick operation is 
already running on the volume ${volumeName} in cluster ${vdsGroup}.")
+    String 
ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REMOVE_BRICK_IN_PROGRESS();
+
     @DefaultStringValue("Cannot ${action} ${type}. The Network Interface 
${IfaceName} has an invalid MAC address ${MacAddress}. MAC address must be in 
format \"HH:HH:HH:HH:HH:HH\" where H is a hexadecimal character (either a digit 
or A-F, case is insignificant).")
     String ACTION_TYPE_FAILED_NETWORK_INTERFACE_MAC_INVALID();
 
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 ff19764..b7f6913 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 @@
 ACTION_TYPE_FAILED_IMAGE_UNRECOGNIZED=Cannot ${action} ${type}. Either the 
image is missing, or its format is corrupted or unrecognizable.
 ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED=Cannot ${action} 
${type}. Rebalance is not running on the volume ${volumeName} in cluster 
${vdsGroup}.
 ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REBALANCE_IN_PROGRESS= Cannot 
${action} ${type}. Rebalance is running on the volume ${volumeName} in cluster 
${vdsGroup}.
+ACTION_TYPE_FAILED_GLUSTER_VOLUME_CANNOT_STOP_REMOVE_BRICK_IN_PROGRESS= Cannot 
${action} ${type}. Remove brick operation is already running on the volume 
${volumeName} in cluster ${vdsGroup}.
 ACTION_TYPE_FAILED_GLUSTER_OPERATION_INPROGRESS=Cannot ${action} ${type}. 
Gluster operation is in progress in cluster. Please try again.
 ACTION_TYPE_FAILED_TAG_ID_REQUIRED=Cannot ${action} ${type}. Tag ID is 
required.
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7f227b086e78374b385ebd2f4d8f8591825c7fe
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Karnan t c <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to