[Freeipa-devel] [PATCH] If plugin fails to load log the traceback

John Dennis jdennis at redhat.com
Thu Nov 19 16:56:14 UTC 2009


Signed-off-by: John Dennis <jdennis at redhat.com>

If plugin fails to load log the traceback

If a plugin fails to load due to some kind of error it would be nice
if the error log contained the traceback so you can examine what went
wrong rather than being left blind as to why it failed to load.

---

 ipalib/plugable.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
-------------- next part --------------
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index 12746c1..d44d688 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -575,7 +575,8 @@ class API(DictProxy):
                     'skipping plugin module %s: %s', fullname, e.reason
                 )
             except StandardError, e:
-                self.log.error('could not load plugin module %r', pyfile)
+                import traceback
+                self.log.error('could not load plugin module %r\n%s', pyfile, traceback.format_exc())
                 raise e
 
     def finalize(self):


More information about the Freeipa-devel mailing list