From Juan Hernandez <juan.hernandez(a)redhat.com>:
Juan Hernandez has submitted this change and it was merged.
Change subject: Fix writing of lists of structs
......................................................................
Fix writing of lists of structs
Currently when the type of an attribute is a list of structs, the SDK
generates the XML using the name of the attribute as the tag for the
list, and the same name in singular as the tag for the elements. For
example, for the Bonding.slaves attribute it generates the following:
<bonding>
<slaves>
<slave>
<name>eth0</name>
</slave>
<slave>
<name>eth1</name>
</slave>
</slaves>
</bonding>
But the server expects the name of the type of the element:
<bonding>
<slaves>
<host_nic>
<name>eth0</name>
</host_nic>
<host_nic>
<name>eth1</name>
</host_nic>
</slaves>
</bonding>
Note the use of 'host_nic' instead of 'slave'.
The behaviour of the SDK is conceptually more correct than the behaviour
of the server, but as we need to support the existing server, without
changes, we need to fix the SDK instead.
Change-Id: I98722ac732e1fd6a5e2212138890639e6784e5d6
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
---
M generator/src/main/java/org/ovirt/sdk/ruby/WritersGenerator.java
A sdk/spec/bonding_writer_spec.rb
2 files changed, 55 insertions(+), 7 deletions(-)
Approvals:
Ondra Machacek: Looks good to me, but someone else must approve
Juan Hernandez: Verified; Looks good to me, approved
Jenkins CI: Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/72344
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I98722ac732e1fd6a5e2212138890639e6784e5d6
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine-sdk-ruby
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Ondra Machacek <omachace(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>