From c6d5c4798d57d88d13292810639e985e6a08aff3 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 3 May 2007 20:46:44 +0000 Subject: Warn when python-ldap is not installed and the user is really trying to use the plugin. --- RepSys/plugins/ldapusers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'RepSys/plugins') diff --git a/RepSys/plugins/ldapusers.py b/RepSys/plugins/ldapusers.py index 0c7a6e3..7f08f56 100644 --- a/RepSys/plugins/ldapusers.py +++ b/RepSys/plugins/ldapusers.py @@ -76,9 +76,11 @@ def make_handler(): return config.get(section, option, default, wrap=False) return dummy_wrapper - # only load ldap if it is enabled in configuration, this way we don't - # require everyone to have python-ldap installed - import ldap + try: + import ldap + except ImportError: + raise Error, "LDAP support needs the python-ldap package "\ + "to be installed" def users_wrapper(section, option=None, default=None, walk=False): global users_cache -- cgit v1.2.1