Michael Pasternak has posted comments on this change.

Change subject: restapi: #854479 Attach Disk To VM - Return Disk In Response
......................................................................


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

(2 inline comments)

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendCollectionResource.java
Line 177:     protected R resolveCreated(Guid id,
Line 178:             EntityIdResolver entityResolver,
Line 179:             Class<? extends BaseResource> suggestedParentType) {
Line 180:         try {
Line 181:             Q created = entityResolver.resolve(id);
i'm not sure i understand this change ....
Line 182:             return addLinks(populate(map(created), created), 
suggestedParentType);
Line 183:         } catch (Exception e) {
Line 184:             // we tolerate a failure in the entity resolution
Line 185:             // as the substantive action (entity creation) has


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmDisksResource.java
Line 56:         if (disk.isSetId()) {
Line 57:             return Response.fromResponse(attachDiskToVm(disk))
Line 58:                     
.entity(resolveCreated(Guid.createGuidFromString(disk.getId()),
Line 59:                     getEntityIdResolver(null),
Line 60:                             VM.class)).build();
why not using createResource() if you already wrote resolver-by-id?
this code is hard to read.
Line 61:         }else {
Line 62:             return super.add(disk);
Line 63:         }
Line 64:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1a50077886734f73842141262f5c338979dcae5c
Gerrit-PatchSet: 3
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