summaryrefslogtreecommitdiff
path: root/libvirt-override-virDomainSnapshot.py
Commit message (Collapse)AuthorAgeFilesLines
* override: Convert to list comprehensionPhilipp Hahn2020-08-181-5/+1
| | | | | | :%s/retlist = list()\n\s*\(for \w\+ in ret\):\n\s*retlist.append(\(.*\))\n\n\s*return retlist/return [\2 \1]/ Signed-off-by: Philipp Hahn <hahn@univention.de>
* override: Add manual PEP 484 type annotationsPhilipp Hahn2020-08-181-3/+3
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* Remove legacy libvirtError argumentsPhilipp Hahn2020-08-061-1/+1
| | | | | | | | | | | | The fields have been deprecated in C with git:f60dc0bc09f09c6817d6706a9edb1579a3e2b2b8 They are only passed to the libvirtError constructor, but not stored for later or used anywhere else. sed -ri '/raise libvirtError/s/, \w+=self(\._dom)?//' *.py Signed-off-by: Philipp Hahn <hahn@univention.de>
* generator: Fix domainSnapshot.listAllChildren()Philipp Hahn2020-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | virDomainSnapshot(dom, _obj) expects a reference to the virDomain as its first argument, but virDomainSnapshot.listAllChildren() passes `self` instead: libvirt.py:6459: error: Argument 1 to "virDomainSnapshot" has incompatible type "virDomainSnapshot"; expected "virDomain" >>> import libvirt >>> con = libvirt.open('test:///default') >>> dom = con.lookupByName("test") >>> first = dom.snapshotCreateXML("""<domainsnapshot><name>First</name></domainsnapshot>""") >>> second = dom.snapshotCreateXML("""<domainsnapshot><name>Second</name></domainsnapshot>""") >>> child, = first.listAllChildren() >>> second.domain() <libvirt.virDomain object at 0x7fb32be3cfd0> ^^^^^^^^^ >>> child.domain() <libvirt.virDomainSnapshot object at 0x7fb32bdb9080> ^^^^^^^^^^^^^^^^^ Signed-off-by: Philipp Hahn <hahn@univention.de>
* python: treat flags as default argument with value 0Guannan Ren2013-03-221-1/+1
| | | | | | | | | | | The following four functions have not changed because default arguments have to come after positional arguments. Changing them will break the the binding APIs. migrate(self, dconn, flags, dname, uri, bandwidth): migrate2(self, dconn, dxml, flags, dname, uri, bandwidth): migrateToURI(self, duri, flags, dname, bandwidth): migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):
* python: Fix bindings for virDomainSnapshotGet{Domain,Connect}v1.0.2-rc2v1.0.2CVE-2013-0170Jiri Denemark2013-01-241-0/+8
| | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=895882 virDomainSnapshot.getDomain() and virDomainSnapshot.getConnect() wrappers around virDomainSnapshotGet{Domain,Connect} were not supposed to be ever implemented. The class should contain proper domain() and connect() accessors that fetch python objects stored internally within the class. While domain() was already provided, connect() was missing. This patch adds connect() method to virDomainSnapshot class and reimplements getDomain() and getConnect() methods as aliases to domain() and connect() for backward compatibility.
* list: provide python bindings for snapshotsv0.9.13-rc2v0.9.13-rc1v0.9.13Eric Blake2012-06-191-0/+11
This adds support for the new virDomainListAllSnapshots (a domain function) and virDomainSnapshotListAllChildren (a snapshot function) to the libvirt-python bindings. The implementation is done manually as the generator does not support wrapping lists of C pointers into python objects. * python/libvirt-override.c (libvirt_virDomainListAllSnapshots) (libvirt_virDomainSnapshotListAllChildren): New functions. * python/libvirt-override-api.xml: Document them. * python/libvirt-override-virDomain.py (listAllSnapshots): New file. * python/libvirt-override-virDomainSnapshot.py (listAllChildren): Likewise. * python/Makefile.am (CLASSES_EXTRA): Ship them.