Juan Hernandez has posted comments on this change. Change subject: sdk: Add empty export method to decorator base ......................................................................
Patch Set 3: (2 comments) http://gerrit.ovirt.org/#/c/24131/3//COMMIT_MSG Commit Message: Line 16: class VMSnapshotDisk(params.Disk, Base) Line 17: Line 18: This means that resource decorators implement the "export" method, Line 19: responsible for generating the XML representation of the entity, but Line 20: collection decorators don't implement it. > collections decorators does not extend api objects, it's standalong wrapper I agree that it doesn't make sense to marshal a collection decorator. But entity decorators are marshalled, when used as parameters, and they contain references to collection decorators, thus the infrastructure tries to marshal them. That is what fails, and what I try to solve adding an empty "export" method. Line 21: Line 22: There are situations where decorators are used as parameters, for Line 23: example, when creating a VM from a snapshot one could use the following Line 24: code: Line 44: they don't have such method. Line 45: Line 46: This usage is not good practice, and not efficient, it is better to Line 47: avoid using decorators as parameters: Line 48: > Juan, This doesn't work for collection decorators, because they don't extend the corresponding collection parameter classes. Line 49: snapshot = ovirtsdk.params.Snapshot(id="...") Line 50: snapshots = ovirtsdk.params.Snapshots() Line 51: snapshots.add_snapshot(snapshot) Line 52: newvm = ovirtsdk.xml.params.VM( -- To view, visit http://gerrit.ovirt.org/24131 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7843dea85c9f09de5fb3439f57dba71ce6a28898 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine-sdk Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Michael Pasternak <mishka8...@yahoo.com> Gerrit-Reviewer: Ravi Nori <rn...@redhat.com> Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches