Kanagaraj M has posted comments on this change. Change subject: gluster: Added additional can do action check ......................................................................
Patch Set 1: (2 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()); If this block of code is not applicable to startRemoveBrick, you can move this code to GlusterBrickValidator 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())) { you can use ListUtils to compare two lists 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 -- 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 <shtri...@redhat.com> Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Sahina Bose <sab...@redhat.com> Gerrit-Reviewer: Shubhendu Tripathi <shtri...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches