Juan Hernandez has uploaded a new change for review.

Change subject: restapi: Use current name when updating pool
......................................................................

restapi: Use current name when updating pool

When updating a VM pool the RESTAPI tries to find the VM data using the
name of the pool, but it uses the name provided by the caller, which may
not be provided, or different to the current one. The effect of this is
that any update not containing the name of the pool fails with a 404
response code. This patch changes that logic to use the current name of
the pool.

Change-Id: Icfd4ae9bf7efed8db6b22cfa7e5dbdbd62cd1136
Related: https://bugzilla.redhat.com/1085386
Signed-off-by: Juan Hernandez <[email protected]>
---
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResource.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/49/26949/1

diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResource.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResource.java
index e027433..fdffc83 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResource.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResource.java
@@ -113,7 +113,7 @@
                 vm.setVmtGuid(new Guid(incoming.getTemplate().getId()));
             } else {
                 final VM existing = currentVmCount > 0
-                              ? getEntity(VM.class, SearchType.VM, "Vms: 
pool=" + incoming.getName())
+                              ? getEntity(VM.class, SearchType.VM, "Vms: 
pool=" + current.getName())
                               : null;
                 if (existing != null) {
                     vm.setVmtGuid(existing.getVmtGuid());


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icfd4ae9bf7efed8db6b22cfa7e5dbdbd62cd1136
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Juan Hernandez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to