Change in ovirt-engine[master]: frontend: new VM from template blank value in target sd list

tnisan at redhat.com tnisan at redhat.com
Sun Nov 22 10:34:20 UTC 2015


Tal Nisan has submitted this change and it was merged.

Change subject: frontend: new VM from template blank value in target sd list
......................................................................


frontend: new VM from template blank value in target sd list

When creating a VM from a template, one can choose on which storage
domain to store each new VM's disk.
Given the list of storage domains where we can do that, we used to
select the first storage domain by default from disk.getStorageIds().
The problem was that if this storage domain was not in the list of
storage domains where we can store the new VM's disk, null was selected,
creating a blank option in the list and blocking the whole command from
executing.

This patch uses Linq.IdsPredicate instead of Linq.StoragePredicate.
Thus, now we go over the list of storage domains, check whether each
storage domain exists in disk.getStorageIds(), and select it if it does.
If there's no match, the first storage domain in the list will be
selected by default (by using Linq.firstOrDefault instead of
Linq.firstOrNull), and the command will fail the canDoAction with an
appropriate error stating that there's no active storage domain the disk
can be read from.

Change-Id: Ic9628c9404030f38cae8e7bb13edca4a299594db
Bug-Url: https://bugzilla.redhat.com/1282085
Signed-off-by: Idan Shaby <ishaby at redhat.com>
---
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Linq.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/DisksAllocationModel.java
2 files changed, 25 insertions(+), 4 deletions(-)

Approvals:
  Tal Nisan: Looks good to me, approved; Passed CI tests
  Allon Mureinik: Looks good to me, but someone else must approve
  Idan Shaby: Verified



-- 
To view, visit https://gerrit.ovirt.org/48644
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic9628c9404030f38cae8e7bb13edca4a299594db
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list