summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <solj+dev@soljerome.com>2011-05-09 08:06:52 -0700
committerSol Jerome <solj+dev@soljerome.com>2011-05-09 08:06:52 -0700
commitafa8530cf2bb59887af4d9d20955a8c3467d64a7 (patch)
tree9718c3bc0266de028dc8c30eeead737e8b56c9d8 /src
parent11b3757156c5c9e5c4095ebd315443baa70f78b7 (diff)
parent51aa48695413ccfa069b9c5bf9441dbd51d09f21 (diff)
downloadbcfg2-afa8530cf2bb59887af4d9d20955a8c3467d64a7.tar.gz
bcfg2-afa8530cf2bb59887af4d9d20955a8c3467d64a7.tar.bz2
bcfg2-afa8530cf2bb59887af4d9d20955a8c3467d64a7.zip
Merge pull request #29 from trehn/plugin-ldap-dev-trehn
Two small fixes for Ldap plugin
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/Ldap.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Ldap.py b/src/lib/Server/Plugins/Ldap.py
index b904dbe02..06ecaed7b 100644
--- a/src/lib/Server/Plugins/Ldap.py
+++ b/src/lib/Server/Plugins/Ldap.py
@@ -1,9 +1,18 @@
import imp
+import logging
+import sys
import time
-import ldap
import Bcfg2.Options
import Bcfg2.Server.Plugin
+logger = logging.getLogger('Bcfg2.Plugins.Ldap')
+
+try:
+ import ldap
+except:
+ logger.error("Unable to load ldap module. Is python-ldap installed?")
+ raise ImportError
+
# time in seconds between retries after failed LDAP connection
RETRY_DELAY = 5
# how many times to try reaching the LDAP server if a connection is broken