Juan Hernandez has submitted this change and it was merged.
Change subject: restapi: Reload host after cluster update
......................................................................
restapi: Reload host after cluster update
When a host is updated the backend requires an special handling of the
cluster: due to permissions issues it has to be changed with the special
ChangeVDSCluster command. The rest of properties of the host can be
changed with the UpdateVds command. Due to this limitation the REST API
performs the update in two steps: first it checks if the cluster needs
to be udpated and then runs the ChangeVDSCluster command, then it
updates the rest of the attributes with the UpdateVds command. But the
host entity is loaded before the first command, and then passed to the
second as a parameter, thus it contains the old cluster id. The
UpdateVds command checks this and refuses the execute the operation
because it thinks that the cluster is changing. To solve this problem we
are reloading the entity after changing the cluster and before sending
it to the UpdateVds command.
Change-Id: If6470ad9ce07a3a5f68146d0b73b2f50ba508b0f
Bug-Url:
https://bugzilla.redhat.com/1046336
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
---
M
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
M
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendHostResourceTest.java
2 files changed, 8 insertions(+), 3 deletions(-)
Approvals:
Juan Hernandez: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/22739
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If6470ad9ce07a3a5f68146d0b73b2f50ba508b0f
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpastern(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server