Change in ovirt-engine[master]: userportal: When can not take VM from pool, UP throws an exc...

vszocs at redhat.com vszocs at redhat.com
Tue Jun 12 12:20:54 UTC 2012


Vojtech Szocs has submitted this change and it was merged.

Change subject: userportal: When can not take VM from pool, UP throws an exception
......................................................................


userportal: When can not take VM from pool, UP throws an exception

When tring to take a VM from a pool, but it did not succeeded
(e.g. because there are no available VMs in the pool), than the
UP throws an UnsupportedOperationException, the model gets in
incorrect state and the UP is not functional any more.

The problem was, that the PoolItemBehaviour.TakeVm() was
not checking the result of the AttachUserToVmFromPoolAndRun
callback and tried to work with the taken VM immediately.
Because the taking of the VM failed, the VM was null and the
UserPoralItemModel.OnEntityChanged() did throw an
UnsupportedOperationException.

Solved by adding a check if the operation succeeded to the
PoolItemBehaviour.TakeVm() and continue only if yes.

Change-Id: If110f01cf2abcd8866ac970b6ac4dabf2df7c4cc
Signed-off-by: Tomas Jelinek <tjelinek at redhat.com>
---
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/PoolItemBehavior.java
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Vojtech Szocs: Verified; Looks good to me, approved


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

Gerrit-MessageType: merged
Gerrit-Change-Id: If110f01cf2abcd8866ac970b6ac4dabf2df7c4cc
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjelinek at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek at redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs at redhat.com>



More information about the Engine-commits mailing list