Change in ovirt-engine[ovirt-engine-3.4]: restapi: Validate dest when importing VM

Oved Ourfali has submitted this change and it was merged. Change subject: restapi: Validate dest when importing VM ...................................................................... restapi: Validate dest when importing VM When importing a VM it is mandatory to specify the destination storage domain. The RESTAPI doesn't currently validate this, and thus the request is accepted and eventually it generates a NPE since AbstractBackendStorageDomainContentResource#getDestStorageDomainId is counting on the storage id. This patch changes the RESTAPI so that it validates that the id or name of the destination storage domain has been provided. If it isn't provided it will generate the following error response: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <fault> <reason>Incomplete parameters</reason> <detail>Action [storageDomain.id|name] required for doImport</detail> </fault> The patch should keep backward compatibility since before it, we got an NPE, and now it is being replaced with an informative message. Change-Id: Id9f0e743de7260b0a838b1da2bd94ac48b28d6be Bug-Url: https://bugzilla.redhat.com/1081132 Signed-off-by: MAor Lipchuk <mlipchuk@redhat.com> --- M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainVmResource.java M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainVmResourceTest.java 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Juan Hernandez: Looks good to me, but someone else must approve Allon Mureinik: Looks good to me, approved Maor Lipchuk: Verified -- To view, visit http://gerrit.ovirt.org/27007 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id9f0e743de7260b0a838b1da2bd94ac48b28d6be Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.4 Gerrit-Owner: Maor Lipchuk <mlipchuk@redhat.com> Gerrit-Reviewer: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernandez@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipchuk@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourfali@redhat.com> Gerrit-Reviewer: automation@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server
participants (1)
-
oourfali@redhat.com