Change in ovirt-engine-sdk[master]: Add generic reader
omachace at redhat.com
omachace at redhat.com
Tue Aug 23 09:34:40 UTC 2016
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 at 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 at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
More information about the Engine-commits
mailing list