Ramesh N has uploaded a new change for review. Change subject: engine: modify stopRemoveBrick command to allow when task is finished ......................................................................
engine: modify stopRemoveBrick command to allow when task is finished Change canDoAction to allow Stop Remove brick to be called even when the task is finished( data migration complete). This helps to implement the Retain Bricks UI command. Also change the remove-brick step status to ABORTED. changing the step status from FINISHED to ABORTED is not allowed through Step.markStepEnded. Hence explicitly update the status and endtime in GlusterAsyncCommand.endStepJob. Change-Id: I88e53fa1772427ea1ae2b6943b76e9a71e772376 Signed-off-by: Ramesh Nachimuthu <rnach...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterAsyncCommandBase.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRemoveGlusterVolumeBricksCommand.java 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/10/20110/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterAsyncCommandBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterAsyncCommandBase.java index 1bab99f..75d25a6 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterAsyncCommandBase.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterAsyncCommandBase.java @@ -1,6 +1,7 @@ package org.ovirt.engine.core.bll.gluster; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -84,7 +85,8 @@ GlusterAsyncTask asyncTask = getGlusterVolume().getAsyncTask(); // Gluster Task will be associated with only one step ( REBALANCING_VOLUME or REMOVING_BRICK) Step step = getStepDao().getStepsByExternalId(asyncTask.getTaskId()).get(0); - step.markStepEnded(status); + step.setStatus(status); + step.setEndTime(new Date()); step.setDescription(ExecutionMessageDirector.resolveStepMessage(getStepType(), stepMessageMap)); JobRepositoryFactory.getJobRepository().updateStep(step); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRemoveGlusterVolumeBricksCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRemoveGlusterVolumeBricksCommand.java index b1c39be..7afe845 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRemoveGlusterVolumeBricksCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRemoveGlusterVolumeBricksCommand.java @@ -40,7 +40,8 @@ } if (!(GlusterTaskUtils.isTaskOfType(volume, GlusterTaskType.REMOVE_BRICK)) - || !(GlusterTaskUtils.isTaskStatus(volume, JobExecutionStatus.STARTED))) { + || !(GlusterTaskUtils.isTaskStatus(volume, JobExecutionStatus.STARTED) || GlusterTaskUtils.isTaskStatus(volume, + JobExecutionStatus.FINISHED))) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_STARTED); } -- To view, visit http://gerrit.ovirt.org/20110 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88e53fa1772427ea1ae2b6943b76e9a71e772376 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ramesh N <rnach...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches