Kanagaraj M has posted comments on this change.
Change subject: gluster: Added additional can do action check
......................................................................
Patch Set 1:
(4 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterAsyncCommandBase.java
Line 54: if (params.getBricks().isEmpty()) {
Line 55: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED);
Line 56: }
Line 57:
Line 58: List<GlusterBrickEntity> bricksForTask =
getGlusterBrickDao().getGlusterVolumeBricksByTaskId(asyncTask.getTaskId());
In case of startRemoveBrick, bricksForTask will be empty
Line 59: List<GlusterBrickEntity> paramBricks = params.getBricks();
Line 60: if (paramBricks.size() != bricksForTask.size()) {
Line 61: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_PARAMS_SIZE_DOES_NOT_MATCH);
Line 62: }
Line 64: int counter = 0;
Line 65: for (GlusterBrickEntity paramBrick : paramBricks) {
Line 66: for (GlusterBrickEntity brick : bricksForTask) {
Line 67: // If parameter brick directory matches with any
brick no need to continue further to check
Line 68: if
(paramBrick.getBrickDirectory().equals(brick.getBrickDirectory())) {
missing hostId check
Line 69: break;
Line 70: }
Line 71: counter++;
Line 72: // If the bricks list exhausted, it means the
parameter brick does found, throw an error
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CommitRemoveGlusterVolumeBricksCommandTest.java
Line 176: brick2.setBrickDirectory("/tmp/test-vol122");
Line 177: brick2.setStatus(GlusterStatus.UP);
Line 178: bricks.add(brick2);
Line 179: return bricks;
Line 180: }
This methods can be moved to a common parent class to avoid the repetition
Line 181:
Line 182: @SuppressWarnings("unchecked")
Line 183: private void mockBackend(boolean succeeded, VdcBllErrors
errorCode) {
Line 184: when(cmd.getBackend()).thenReturn(backend);
....................................................
File backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
Line 957: ACTION_TYPE_FAILED_GLUSTER_VOLUME_NOT_DISTRIBUTED=Cannot ${action}
${type}. Gluster Volume is not distributed.
Line 958:
ACTION_TYPE_FAILED_GLUSTER_VOLUME_DISTRIBUTED_AND_HAS_SINGLE_BRICK=Cannot
${action} ${type}. Gluster Volume has a single brick.
Line 959: ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_STARTED=Cannot
${action} ${type}. Remove brick not started.
Line 960: ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_FINISHED=Cannot
${action} ${type}. Remove brick not finished.
Line 961:
ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_PARAMS_SIZE_DOES_NOT_MATCH=Cannot
${action} ${type}. The no of bricks does not match with the bricks used while
starting the action.
I feel this is not required, below one is enough to convey the error
Line 962: ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_PARAMS_INVALID=Cannot
${action} ${type}. The list of bricks does not match with the bricks used while
starting the action.
Line 963: ACTION_TYPE_FAILED_NOT_A_GLUSTER_VOLUME_BRICK=Cannot ${action}
${type}. Replacing brick is not a Gluster volume brick.
Line 964: ACTION_TYPE_FAILED_NO_GLUSTER_HOST_TO_PEER_PROBE=Cannot ${action}
${type}. There is no available server in the cluster to probe the new server.
Line 965: ACTION_TYPE_FAILED_CAN_NOT_REDUCE_REPLICA_COUNT_MORE_THAN_ONE=Cannot
${action} ${type}. Replica count cannot be reduced by more than one.
--
To view, visit http://gerrit.ovirt.org/22353
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id7f5d3b48985552aa5f74178008beb39ee7a06f9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shubhendu Tripathi <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches