]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Print any exception that occurs in authentication callback
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 10 Sep 2012 15:44:40 +0000 (16:44 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 11 Sep 2012 11:16:17 +0000 (12:16 +0100)
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>
python/libvirt-override.c

index c51dd3fac964e59cebff5d170e7a9bd849c9959d..768144a009690fdbf9e60dd58b53c88f8f341fa3 100644 (file)
@@ -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) {