Module: check_mk
Branch: master
Commit: aaaf9899067345386e083620a60ffe87e4f7fb4d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aaaf9899067345…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 5 17:33:53 2012 +0100
ldap: added debug notes
---
web/plugins/userdb/ldap.py | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 8538efd..8942f77 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -29,7 +29,19 @@ import time
# FIXME: For some reason mod_python is missing /usr/lib/python2.7/dist-packages
# in sys.path. Therefor the ldap module can not be found. Need to fix this!
-import sys ; sys.path.append('/usr/lib/python2.7/dist-packages')
+#import sys ; sys.path.append('/usr/lib/python2.7/dist-packages')
+#
+# details: /usr/lib/python2.7/site.py
+#
+# My assumption is that there is a problem during compilation/execution of mod_python.
+# When starting python as site user, the correct sys.path is set, when printing sys.path
+# from mod_python code for debugging, it misses a lot of paths.
+#
+# mod_python:
+# ['/omd/sites/event/local/share/check_mk/web/htdocs',
'/omd/sites/event/share/check_mk/web/htdocs',
'/omd/versions/2012.10.25.mk/lib/python', '/omd/sites/event/lib/python',
'/omd/sites/event/local/lib/python', '/usr/lib/python2.7/',
'/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload']
+#
+# >>> sys.path
+# ['', '/usr/local/lib/python2.7/dist-packages/pip-1.1-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/xhtml2pdf-0.0.4-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/pyPdf-1.13-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/html5lib-0.95-py2.7.egg',
'/usr/lib/python2.7/dist-packages/PIL',
'/usr/local/lib/python2.7/dist-packages/pisa-3.0.33-py2.7.egg',
'/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/gst-0.10',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
'/usr/lib/python2.7/dist-packages/ubuntuone-couch',
'/usr/lib/python2.7/dist-packages/ubuntuone-installer',
'/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol',
'/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']
try:
# docs:
http://www.python-ldap.org/doc/html/index.html
import ldap