diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2007-04-16 12:37:59 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2007-04-16 12:37:59 +0000 |
commit | 33af9b643ad0c342bb058453ae50035e8abdbb0e (patch) | |
tree | 9b36f1705f1287c514a87e0cc3039050b03f1ad4 /libvir.py | |
parent | 09e33225d13297467fd7fd863ea55cbe04b3f486 (diff) | |
download | libvirt-python-split-33af9b643ad0c342bb058453ae50035e8abdbb0e.tar.gz libvirt-python-split-33af9b643ad0c342bb058453ae50035e8abdbb0e.tar.xz libvirt-python-split-33af9b643ad0c342bb058453ae50035e8abdbb0e.zip |
Fixed exception reporting for domain/network operationsv0.2.2
Diffstat (limited to 'libvir.py')
-rw-r--r-- | libvir.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -9,9 +9,14 @@ import types # The root of all libvirt errors. class libvirtError(Exception): - def __init__(self, msg, conn=None): + def __init__(self, msg, conn=None, dom=None, net=None): Exception.__init__(self, msg) + if dom is not None: + conn = dom._conn + elif net is not None: + conn = net._conn + if conn is None: self.err = virGetLastError() else: |