Tal Nisan has uploaded a new change for review.

Change subject: restapi: Do not attempt to extend a block domain if LUNs data 
not supplied
......................................................................

restapi: Do not attempt to extend a block domain if LUNs data not supplied

When editing a block domain via REST, in case the storage data was not
supplied there is still a comparison between the old an new LUNs which
results in an NPE, in that case we just skip the comparison if the data
was not sent in the request

Change-Id: Ibf4b28c2dbc289b88107f1e7fdc19127fb536326
Bug-Url: https://bugzilla.redhat.com/1115966
Signed-off-by: Tal Nisan <tni...@redhat.com>
---
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainResource.java
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/98/33498/1

diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainResource.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainResource.java
index 5c9a354c..bba0bce 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainResource.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainResource.java
@@ -135,6 +135,10 @@
      * @param incoming
      */
     private void extendStorageDomain(StorageDomain incoming, StorageDomain 
storageDomain, StorageType storageType) {
+        if (incoming.getStorage() == null) {
+        // LUNs info was not supplied in the request so no need to check 
whether to extend
+            return;
+        }
         List<LogicalUnit> existingLuns = 
storageDomain.getStorage().getVolumeGroup().getLogicalUnits();
         List<LogicalUnit> incomingLuns = 
getIncomingLuns(incoming.getStorage());
         List<LogicalUnit> newLuns = findNewLuns(existingLuns, incomingLuns);


-- 
To view, visit http://gerrit.ovirt.org/33498
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf4b28c2dbc289b88107f1e7fdc19127fb536326
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <tni...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to