Change in ovirt-engine-sdk[sdk_4.0]: Add generic reader
omachace at redhat.com
omachace at redhat.com
Tue Aug 23 09:39:00 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>
(cherry picked from commit 4f8e4c5ba72b7b0777b372cc12d8cb1e4691a52f)
---
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/62715
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe55914453ea6c6c7e46406bdcbad7acaa813721
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: sdk_4.0
Gerrit-Owner: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
More information about the Engine-commits
mailing list