Michael Pasternak has posted comments on this change.

Change subject: restapi: Direct-LUN Disk Creation - Dont Require Size
......................................................................


Patch Set 2: I would prefer that you didn't submit this

(3 inline comments)

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDisksResource.java
Line 28: 
Line 29:     @Override
Line 30:     public Response add(Disk disk) {
Line 31:         validateParameters(disk, "format", "interface");
Line 32:         if (!disk.isSetLunStorage() || 
disk.getLunStorage().getLogicalUnits().isEmpty()) { // lun-disk does not require
potential NPE, at disk.getLunStorage().getLogicalUnits().isEmpty(),

disk.getLunStorage().getLogicalUnits() can be NULL
Line 33:                                                                        
                    // size
Line 34:             validateParameters(disk, "provisionedSize|size");
Line 35:         }
Line 36:         validateEnums(Disk.class, disk);


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmDisksResource.java
Line 55:         if (disk.isSetId()) {
Line 56:             return attachDiskToVm(disk);
Line 57:         }else {
Line 58:             validateParameters(disk, "format", "interface");
Line 59:             if (!disk.isSetLunStorage()) {// lun-disk does not require 
size
this check should be the same as in BackendDisksResource.add()
Line 60:                 validateParameters(disk, "provisionedSize|size");
Line 61:             }
Line 62:             return performCreation(addAction,
Line 63:                     getAddParameters(map(disk), disk),


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmDisksResourceTest.java
Line 344:         try {
Line 345:             collection.add(model);
Line 346:             fail("expected WebApplicationException on incomplete 
parameters");
Line 347:         } catch (WebApplicationException wae) {
Line 348:             verifyIncompleteException(wae, "Disk", "add", 
"provisionedSize|size");
i don't get it, if you validate "provisionedSize|size", this is non-lun disk?!,
where is the test for lun-disk?
Line 349:         }
Line 350:     }
Line 351: 
Line 352:     @Test


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie8dba8d1e1b20ff5f81d9cfa944d3bfcd5630bc1
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to