Change in ovirt-engine[ovirt-engine-3.3]: restapi: Reload host after cluster update

iheim at redhat.com iheim at redhat.com
Thu Dec 26 17:35:29 UTC 2013


Itamar Heim 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 at 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/22747
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If6470ad9ce07a3a5f68146d0b73b2f50ba508b0f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Eyal Edri <eedri at redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list