1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-15 01:49:26 +03:00

* python/libvir.py python/libvirt-python-api.xml: more python

cleanups by Cole Robinson
Daniel
This commit is contained in:
Daniel Veillard
2008-06-11 07:49:01 +00:00
parent 1b58a90c1a
commit f0332b83e0
2 changed files with 10 additions and 1 deletions

View File

@ -15,13 +15,17 @@ import types
# The root of all libvirt errors.
class libvirtError(Exception):
def __init__(self, msg, conn=None, dom=None, net=None):
def __init__(self, msg, conn=None, dom=None, net=None, pool=None, vol=None):
Exception.__init__(self, msg)
if dom is not None:
conn = dom._conn
elif net is not None:
conn = net._conn
elif pool is not None:
conn = pool._conn
elif vol is not None:
conn = vol._conn
if conn is None:
self.err = virGetLastError()