Maor Lipchuk has posted comments on this change. Change subject: engine: Commands to add, edit and remove iscsi bonds ......................................................................
Patch Set 6: (5 comments) http://gerrit.ovirt.org/#/c/22952/6/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddIscsiBondCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddIscsiBondCommand.java: Line 37: TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { Line 38: Line 39: @Override Line 40: public Void runInTransaction() { Line 41: getDbFacade().getIscsiBondDao().save(iscsiBond); Worth to extract getDbFacade().getIscsiBondDao() to a method. Same for all commands Line 42: Line 43: for (Guid networkId : networkIds) { Line 44: getDbFacade().getIscsiBondDao().addNetworkToIscsiBond(iscsiBond.getId(), networkId); Line 45: } http://gerrit.ovirt.org/#/c/22952/6/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/EditIscsiBondCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/EditIscsiBondCommand.java: Line 25: setStoragePoolId(parameters.getNewIscsiBond().getStoragePoolId()); Line 26: } Line 27: Line 28: public EditIscsiBondCommand(Guid commandId) { Line 29: super(commandId); indentation? Line 30: } Line 31: Line 32: @Override Line 33: protected void executeCommand() { Line 31: Line 32: @Override Line 33: protected void executeCommand() { Line 34: Line 35: final IscsiBond oldIscsiBond = getParameters().getOldIscsiBond(); old Iscsi bond should be from the DB Line 36: final IscsiBond newIscsiBond = getParameters().getNewIscsiBond(); Line 37: Line 38: TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { Line 39: http://gerrit.ovirt.org/#/c/22952/6/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveIscsiBondCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveIscsiBondCommand.java: Line 33: Line 34: @Override Line 35: public List<PermissionSubject> getPermissionCheckSubjects() { Line 36: return Collections.singletonList(new PermissionSubject(getStoragePoolId(), Line 37: VdcObjectType.StoragePool, getActionType().getActionGroup())); We must validate if the storage pool is related to the IscsiBondId. (Should be in the CDA) Line 38: } http://gerrit.ovirt.org/#/c/22952/6/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/EditIscsiBondParameters.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/EditIscsiBondParameters.java: Line 14: Line 15: public EditIscsiBondParameters() { Line 16: } Line 17: Line 18: public EditIscsiBondParameters(IscsiBond newIscsiBond, IscsiBond oldIscsiBond) { Why should we need to oldIscsiBond? this should be fetched from the DB Line 19: setNewIscsiBond(newIscsiBond); Line 20: setOldIscsiBond(oldIscsiBond); Line 21: } Line 22: -- To view, visit http://gerrit.ovirt.org/22952 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06890ea40d22b86d9421cb1b0c68ea28bc430b0a Gerrit-PatchSet: 6 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sergey Gotliv <sgot...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Sergey Gotliv <sgot...@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