Daniel Erez has submitted this change and it was merged.
Change subject: webadmin: prevent several imported VMs with same name
webadmin: prevent several imported VMs with same name
This patch prevents the user from assigning the same name for several
imported VMs. if the user tries to assign a name that was already been
assigned for a different VM that is going to be imported, the name field
will be marked as invalid with a proper error message.
When the user tried to import multiple VMs that already exist, he could
choose a different name for each of them. when doing so, there was no
validation that ensures the user don't assign the same name for several
VMs, so the backend got that bunch of VMs to import with the given names
and created them without checking that each name is unique (because it's
done as multiple actions, thus not checking canDoAction on each of them),
and the result is that there were multiple VMs created with the same name.
So this patch prevents this situation from happening by ensuring that
the UI don't pass several VMs with the same name to import to the
backend, by adding a proper validation for the name field of the
to-be-imported VM which checks that it's unique.
Signed-off-by: Arik Hadas <ahadas(a)redhat.com>
4 files changed, 184 insertions(+), 66 deletions(-)
Daniel Erez: Verified; Looks good to me, approved
To view, visit http://gerrit.ovirt.org/12203
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-Owner: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik(a)redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek(a)redhat.com>