From 33af9b643ad0c342bb058453ae50035e8abdbb0e Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 16 Apr 2007 12:37:59 +0000 Subject: Fixed exception reporting for domain/network operations --- libvir.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libvir.py') diff --git a/libvir.py b/libvir.py index dc4bc29..e1c4ff3 100644 --- a/libvir.py +++ b/libvir.py @@ -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: -- cgit