[PATCH 2/5] Print any exception that occurs in authentication callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 python/libvirt-override.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index edaa2a4..74a8abf 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) {
-- 
1.7.11.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]