Oved Ourfali has submitted this change and it was merged.
Change subject: restapi: Validate dest when importing template
......................................................................
restapi: Validate dest when importing template
When importing a template 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: I2cf2d94514b159c34f19a7f0377fcb2a9afd1c19
Bug-Url:
https://bugzilla.redhat.com/1081132
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
---
M
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainTemplateResource.java
M
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainTemplateResourceTest.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/27006
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2cf2d94514b159c34f19a7f0377fcb2a9afd1c19
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server