Maor Lipchuk has posted comments on this change. Change subject: core: Log error correctly when connecting domain for removal ......................................................................
Patch Set 2: Code-Review+1 (5 comments) Logic seems good, minor comments regarding enhancments http://gerrit.ovirt.org/#/c/33442/2//COMMIT_MSG Commit Message: Line 5: CommitDate: 2014-09-29 11:36:24 +0300 Line 6: Line 7: core: Log error correctly when connecting domain for removal Line 8: Line 9: When connecting to a storage domain as a part of it's removal (or format /s/it's/its Line 10: in case of ISO domains) if the connection failed the error is not logged Line 11: correctly and instead we get a generic error, this was fixed and instead Line 12: the generic error we will get the real cause Line 13: Line 6: Line 7: core: Log error correctly when connecting domain for removal Line 8: Line 9: When connecting to a storage domain as a part of it's removal (or format Line 10: in case of ISO domains) if the connection failed the error is not logged I didn't understood : "if the connection failed the error" maybe, "if the connection fails, the error"? Line 11: correctly and instead we get a generic error, this was fixed and instead Line 12: the generic error we will get the real cause Line 13: Line 14: Change-Id: Idd7435336acbec41edbdd70568f1dfdce664f875 http://gerrit.ovirt.org/#/c/33442/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/BaseFsStorageHelper.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/BaseFsStorageHelper.java: Line 31: .runInternalAction(VdcActionType.forValue(type), Line 32: new StorageServerConnectionParametersBase(connection, vdsId)); Line 33: result = new Pair<>(returnValue.getSucceeded(), returnValue.getFault()); Line 34: } else { Line 35: result = new Pair<>(false, null); You can initialize this already when declaring it at line 25 Line 36: log.warn("Did not connect host: " + vdsId + " to storage domain: " + storageDomain.getStorageName() Line 37: + " because connection for connectionId:" + storageDomain.getStorage() + " is null."); Line 38: } Line 39: return result; http://gerrit.ovirt.org/#/c/33442/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/FCPStorageHelper.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/FCPStorageHelper.java: Line 18: Line 19: @Override Line 20: public boolean connectStorageToDomainByVdsId(StorageDomain storageDomain, Guid vdsId) { Line 21: return true; Line 22: } > It's parent is StorageHelperBase which actually has this method implemented I think that indeed can be removed, but I'm not sure if this is related to this change... Line 23: Line 24: @Override Line 25: public boolean disconnectStorageFromDomainByVdsId(StorageDomain storageDomain, Guid vdsId) { Line 26: return true; http://gerrit.ovirt.org/#/c/33442/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java: Line 73: VdcFault vdcFault = null; Line 74: if (!isSuccess && returnValue != null && returnValue.getVdsError() != null) { Line 75: vdcFault = new VdcFault(); Line 76: vdcFault.setError(returnValue.getVdsError().getCode()); Line 77: } I would declare "VdcFault vdcFault = null;" at line 49 remove the deceleration of "VDSReturnValue returnValue" from line 44 and instead use it only in line 61 as part of the VDS action scope. then I would set the vdcFault as part of the Vds action scope (line 70). you can avoid checking if returnValue is null that way. Line 78: return new Pair<>(isSuccess, vdcFault); Line 79: } Line 80: Line 81: public static List<StorageServerConnections> updateIfaces(List<StorageServerConnections> conns, Guid vdsId) { -- To view, visit http://gerrit.ovirt.org/33442 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd7435336acbec41edbdd70568f1dfdce664f875 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Idan Shaby <ish...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org 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