Change in ovirt-engine[master]: webadmin: prevent several imported VMs with same name

derez at redhat.com derez at redhat.com
Wed Feb 27 15:45:26 UTC 2013


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.

Change-Id: I69eae7350ae840a06b440003c436f7adc0b032cd
Bug-Url: https://bugzilla.redhat.com/907132
Signed-off-by: Arik Hadas <ahadas at redhat.com>
---
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/TemplateBackupModel.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/VmBackupModel.java
A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/NotInCollectionValidation.java
M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Messages.java
4 files changed, 184 insertions(+), 66 deletions(-)

Approvals:
  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-MessageType: merged
Gerrit-Change-Id: I69eae7350ae840a06b440003c436f7adc0b032cd
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik at redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek at redhat.com>



More information about the Engine-commits mailing list