aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-09-10 16:44:40 +0100
committerDaniel P. Berrange <berrange@redhat.com>2012-09-11 12:16:17 +0100
commit01573bdf4f462a0a7e7a29a37ddfcc7ecff3c049 (patch)
tree85d712b0a768dacf29662bd987723131e1f9c27b /python
parentFix crash passing an empty list to python openAuth() API (diff)
downloadlibvirt-01573bdf4f462a0a7e7a29a37ddfcc7ecff3c049.tar.gz
libvirt-01573bdf4f462a0a7e7a29a37ddfcc7ecff3c049.tar.bz2
libvirt-01573bdf4f462a0a7e7a29a37ddfcc7ecff3c049.zip
Print any exception that occurs in authentication callback
If an exception occurs in the python callback for openAuth() the stack trace isn't seen by the apps, since this code is called from libvirt context. To aid diagnostics, print the error to stderr at least Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'python')
-rw-r--r--python/libvirt-override.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index c51dd3fac..768144a00 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -1776,8 +1776,10 @@ static int virConnectCredCallbackWrapper(virConnectCredentialPtr cred,
PyErr_Clear();
pyret = PyEval_CallObject(pycb, list);
- if (PyErr_Occurred())
+ if (PyErr_Occurred()) {
+ PyErr_Print();
goto cleanup;
+ }
ret = PyLong_AsLong(pyret);
if (ret == 0) {