From 3b3ecb4fcba471d33dbd118c02798e6f3f4b9927 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 25 Sep 2012 15:49:25 -0400 Subject: various pylint fixes --- src/lib/Bcfg2/Server/Plugins/Ldap.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Ldap.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Ldap.py b/src/lib/Bcfg2/Server/Plugins/Ldap.py index 8e5ce2624..f724402d0 100644 --- a/src/lib/Bcfg2/Server/Plugins/Ldap.py +++ b/src/lib/Bcfg2/Server/Plugins/Ldap.py @@ -10,7 +10,7 @@ logger = logging.getLogger('Bcfg2.Plugins.Ldap') try: import ldap -except: +except ImportError: logger.error("Unable to load ldap module. Is python-ldap installed?") raise ImportError @@ -21,16 +21,18 @@ RETRY_DELAY = 5 RETRY_COUNT = 3 SCOPE_MAP = { - "base" : ldap.SCOPE_BASE, - "one" : ldap.SCOPE_ONELEVEL, - "sub" : ldap.SCOPE_SUBTREE, + "base": ldap.SCOPE_BASE, + "one": ldap.SCOPE_ONELEVEL, + "sub": ldap.SCOPE_SUBTREE, } LDAP_QUERIES = [] + def register_query(query): LDAP_QUERIES.append(query) + class ConfigFile(Bcfg2.Server.Plugin.FileBacked): """ Config file for the Ldap plugin @@ -58,6 +60,7 @@ class ConfigFile(Bcfg2.Server.Plugin.FileBacked): LDAP_QUERIES = [] imp.load_source("ldap_cfg", self.filename) + class Ldap(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.Connector): """ The Ldap plugin allows adding data from an LDAP server to your metadata. -- cgit v1.2.3-1-g7c22