mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-03 08:21:58 +03:00
generator: Fix domainSnapshot.listAllChildren()
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>
This commit is contained in:
@ -14,6 +14,6 @@
|
||||
|
||||
retlist = list()
|
||||
for snapptr in ret:
|
||||
retlist.append(virDomainSnapshot(self, _obj=snapptr))
|
||||
retlist.append(virDomainSnapshot(self.domain(), _obj=snapptr))
|
||||
|
||||
return retlist
|
||||
|
Reference in New Issue
Block a user