Module: check_mk
Branch: master
Commit: f12d77fac6affef722c2685147a31c94639694ca
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f12d77fac6affe…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 17 14:05:45 2013 +0200
Do not try to execute the ldap sync after enabling but without config
---
web/plugins/userdb/ldap.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 2ed66a3..d08d00b 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -838,6 +838,9 @@ def ldap_sync(add_to_changelog, only_username):
# requests to e.g. the page hook would cause duplicate calculations
file(g_ldap_sync_time_file, 'w').write('%s\n' % time.time())
+ if not config.ldap_connection:
+ return # silently skip sync without configuration
+
# Flush ldap related before each sync to have a caching only for the
# current sync process
global g_ldap_user_cache, g_ldap_group_cache