Change in ovirt-engine[master]: restapi: cast list results to single entity

juan.hernandez at redhat.com juan.hernandez at redhat.com
Wed Jun 4 13:31:01 UTC 2014


Juan Hernandez has submitted this change and it was merged.

Change subject: restapi: cast list results to single entity
......................................................................


restapi: cast list results to single entity

In change 88756e3 (core: Remove usage of dynamic queries from the
Backend) the dynamic queries were removed from the restapi Backend.
The change didn't take in account that some of the queries were
used to retrieve only one item and therefore doGetEntity should
handle the case (as the old deprecated getEntity method).

An example of the problem was adding a cluster:

 # add cluster --data_center-name DataCenter1 --name Cluster1

failing with a java.lang.ClassCastException (Cannot cast ArrayList
to StoragePool).

Change-Id: I7e96a62cd7a5429a5102c7a9134bee8754b3d128
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
---
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendResource.java
1 file changed, 19 insertions(+), 13 deletions(-)

Approvals:
  Juan Hernandez: Looks good to me, approved
  Federico Simoncelli: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e96a62cd7a5429a5102c7a9134bee8754b3d128
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Liran Zelkha <lzelkha at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list