Liron Aravot has uploaded a new change for review. Change subject: core: preventing NPE on StorageServerConnectionCommandBase ......................................................................
core: preventing NPE on StorageServerConnectionCommandBase Currently we allow to added FCP connections although they aren't supported in oVirt - this has been changed by change 2f7c846 as was required because of how we store the connections password in the DB. After this change in case of added FCP connection, NPE will occur. This patch fixes that by restoring the previous state, we may block adding FCP connections regardless (as having them isn't supported/used by the engine). Change-Id: I6662695ba876f9e3f5a22c3251895049bf9eaedc Bug-Url: https://bugzilla.redhat.com/1176578 Signed-off-by: Liron Aravot <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/56/36456/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java index 87b8d2e..b8fae9e 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java @@ -161,6 +161,7 @@ // same details was already added - so we query the connections with the same (currently relevant) details and // then compare the password after it was already // decrypted. + // NOTE- THIS METHOD IS CURRENTLY USED ALSO FOR FCP connections, change with care. List<StorageServerConnections> connections = DbFacade.getInstance().getStorageServerConnectionDao().getAllForConnection(connection); for (StorageServerConnections dbConnection : connections) { diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java index 782ba70..a102e06 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java @@ -85,7 +85,7 @@ String connectionField = connection.getconnection(); connections = getStorageConnDao().getAllForStorage(connectionField); } - else if (connection.getstorage_type() == StorageType.ISCSI) { + else { StorageServerConnections sameConnection = findConnectionWithSameDetails(connection); connections = sameConnection != null ? Arrays.asList(sameConnection) -- To view, visit http://gerrit.ovirt.org/36456 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6662695ba876f9e3f5a22c3251895049bf9eaedc Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Liron Aravot <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
