Hi,
while working on the Python type annotations for the Python libvirt
binding I noticed the following code in
libvirt-override-virDomainSnapshot.py:
def listAllChildren(self, flags=0):
"""List all child snapshots and returns a list of snapshot
objects"""
...
raise libvirtError("..., conn=self)
"self" is an instance of virDomainSnapshot here.
I found two similar cases where "conn" was not a "virConnect"
instance
in listAllSnapshots() and listAllVolumes().
Compare that with the declaration of libvirtError in libvirt-override.py:
class libvirtError(Exception):
def __init__(self, defmsg, conn=None, dom=None, net=None, pool=None, vol=None):
Looking further at the implementation of that method only "defmsg" is
used; all other references are not accessed and never stored in an
instance variable.
Should I add a new "snap" argument to libvirtError.__init__() or should
we stop passing those references to the constructor altogether?
Patch 2 and 3 might be applied to the current branch already, patch 1
currently depends on my other work.
Philipp
--
Philipp Hahn
Open Source Software Engineer
Univention GmbH
be open.
Mary-Somerville-Str. 1
D-28359 Bremen
Tel.: +49 421 22232-0
Fax : +49 421 22232-99
hahn(a)univention.de
http://www.univention.de/
Geschäftsführer: Peter H. Ganten
HRB 20755 Amtsgericht Bremen
Steuer-Nr.: 71-597-02876