Bug 1328737 - Editing a sub attribute of vm/template initialization attr via API overrides all other sub_attributes
Summary: Editing a sub attribute of vm/template initialization attr via API overrides ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ovirt-4.0.0-beta
: 4.0.0
Assignee: Tomas Jelinek
QA Contact: sefi litmanovich
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-20 08:08 UTC by sefi litmanovich
Modified: 2016-07-05 07:57 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: When editing any attribute of <initialization> using REST API, all attributes have been overridden. Consequence: User of the REST API always had to fill all the attributes of the <initialization> even only not all needed actual update. Fix: Made sure only the actually specified attributes are going to be applied. Result: Now only the attributes which need to be updated have to be specified.
Clone Of:
Environment:
Last Closed: 2016-07-05 07:57:05 UTC
oVirt Team: Virt
rule-engine: ovirt-4.0.0+
rule-engine: planning_ack+
tjelinek: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 56615 0 master MERGED restapi: editing vm_init overrides all attrs 2016-04-27 12:33:04 UTC

Description sefi litmanovich 2016-04-20 08:08:10 UTC
Description of problem:

Editing some sub attribute of vm's or template's initialization attribute via API will override all other sub_attributes e.g.

say you have a template with:

<initialization>
<host_name>foo.bar.com</host_name>
<dns_servers>1.2.3.4</dns_servers
</initialization>

and now you want to change the dns_servers value:

PUT https://{engine_url}/ovirt-engine/api/templates/{template_id}

<template>
<initialization>
<dns_servers>5.6.7.8</dns_servers
</initialization>
</template>

Actual result:
Result is that host_name is overridden and is now blank, only dns_servers will be updated.
This happens with both vm/template entities.

Expected result:
Only the sub attribute given in the PUT call is changed while all other initialization sub attributes' values persist.

Version-Release number of selected component (if applicable):
ovirt-engine-4.0.0-0.0.master.20160405102116.git3819ab7.el7.centos.noarch

How reproducible:
always

No log is helpful in this case and bug is easy to re produce.

Comment 1 sefi litmanovich 2016-07-04 11:55:14 UTC
Verified with rhevm-4.0.2-0.2.rc1.el7ev.noarch according to description, check both vm and template editing - worked as expected.

Comment 2 Sandro Bonazzola 2016-07-05 07:57:05 UTC
oVirt 4.0.0 has been released, closing current release.


Note You need to log in before you can comment on or make changes to this bug.