diff options
author | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-05-03 20:46:44 +0000 |
---|---|---|
committer | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-05-03 20:46:44 +0000 |
commit | c6d5c4798d57d88d13292810639e985e6a08aff3 (patch) | |
tree | 5b93481dae7def8fb0ebd29ea6dbb81ce6d34e64 | |
parent | c7db0f3a0c0a561225355456922a34e8ee0092af (diff) | |
download | mgarepo-c6d5c4798d57d88d13292810639e985e6a08aff3.tar mgarepo-c6d5c4798d57d88d13292810639e985e6a08aff3.tar.gz mgarepo-c6d5c4798d57d88d13292810639e985e6a08aff3.tar.bz2 mgarepo-c6d5c4798d57d88d13292810639e985e6a08aff3.tar.xz mgarepo-c6d5c4798d57d88d13292810639e985e6a08aff3.zip |
Warn when python-ldap is not installed and the user is really trying to use
the plugin.
-rw-r--r-- | RepSys/plugins/ldapusers.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 |