diff options
author | Sol Jerome <solj+dev@soljerome.com> | 2011-05-09 08:06:52 -0700 |
---|---|---|
committer | Sol Jerome <solj+dev@soljerome.com> | 2011-05-09 08:06:52 -0700 |
commit | afa8530cf2bb59887af4d9d20955a8c3467d64a7 (patch) | |
tree | 9718c3bc0266de028dc8c30eeead737e8b56c9d8 /src | |
parent | 11b3757156c5c9e5c4095ebd315443baa70f78b7 (diff) | |
parent | 51aa48695413ccfa069b9c5bf9441dbd51d09f21 (diff) | |
download | bcfg2-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.py | 11 |
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 |