Ondra Machacek has submitted this change and it was merged.
Change subject: Add generic reader
......................................................................
Add generic reader
Currently the SDK doesn't provide any mechanism to read an XML object
without explicitly specifying its type. For example, to read a virtual
machine the only method available is "VmReader.read_one". But there are
situations where the SDK can't know in advance what type of object is
going to be received from the server, for example "action" or
"fault".
To support that, this patch adds a new "Reader.read" method that decides
the type of object based on the name of the first tag, and invokes the
corresponding specific reader to read it.
Change-Id: Ibe55914453ea6c6c7e46406bdcbad7acaa813721
Signed-off-by: Ondra Machacek <omachace(a)redhat.com>
---
M generator/src/main/java/org/ovirt/sdk/python/ReadersGenerator.java
M sdk/lib/ovirtsdk4/reader.py
M sdk/tests/test_reader.py
3 files changed, 215 insertions(+), 30 deletions(-)
Approvals:
Ondra Machacek: Verified; Looks good to me, approved
Jenkins CI: Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/62609
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe55914453ea6c6c7e46406bdcbad7acaa813721
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Ondra Machacek <omachace(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>