Ori Liel has posted comments on this change.

Change subject: restapi: user cannnot take a vm from pool via restapi #864438
......................................................................


Patch Set 2: (2 inline comments)

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendActionableResource.java
Line 38:         try {
Line 39:             VdcReturnValueBase actionResult = doAction(task, params);
Line 40:             if (actionResult.getHasAsyncTasks()) {
Line 41:                 if (expectBlocking(action)) {
Line 42:                     Object model = resolveCreated(actionResult, 
entityResolver, null);
You should resolve the action after waiting for completion is done (move this 
line one line down)
Line 43:                     CreationStatus status = 
awaitCompletion(actionResult, pollingType);
Line 44:                     return actionStatus(status, action, model);
Line 45:                 } else {
Line 46:                     return actionAsync(actionResult, action);


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResource.java
Line 149:             this.queryParamsClass = queryParamsClass;
Line 150:         }
Line 151: 
Line 152:         public org.ovirt.engine.api.model.VM lookupEntity(Guid id) 
throws BackendFailureException {
Line 153:             VM vm = doGetEntity(VM.class,
Why not use getEntity() which wraps doGetEntity() and throws more meaningful 
exceptions? doGetEntity() is almost not used at all in the application, I think 
maybe it's even meant to be private.
Line 154:                     query, getQueryParams(queryParamsClass, id), 
id.toString());
Line 155:             org.ovirt.engine.api.model.VM model = new 
org.ovirt.engine.api.model.VM();
Line 156:             model.setId(vm.getId().toString());
Line 157:             return LinkHelper.addLinks(getUriInfo(), model);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icdd917a5f443bd7e8d06b582ae4559bef90608e6
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Ori Liel <ol...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to