summaryrefslogtreecommitdiffstats
path: root/pykolab/auth/ldap/__init__.py
diff options
context:
space:
mode:
authorPaul Boddie <paul@boddie.org.uk>2013-12-05 17:16:39 +0100
committerPaul Boddie <paul@boddie.org.uk>2013-12-05 17:16:39 +0100
commitc5c6c1dff87d2c7a6e457c351eb510303752f725 (patch)
treea0a5a75208d5a00eed12af963c718c4069e0b9b4 /pykolab/auth/ldap/__init__.py
parent9edbc20941621e88df2c546bf8aa29881ba9f981 (diff)
downloadpykolab-c5c6c1dff87d2c7a6e457c351eb510303752f725.tar.gz
Replaced exec usage with eval at most, otherwise getattr and sometimes setattr.
Refactored common command/component code.
Diffstat (limited to 'pykolab/auth/ldap/__init__.py')
-rw-r--r--pykolab/auth/ldap/__init__.py29
1 files changed, 9 insertions, 20 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 8e65005..f83cd20 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -2366,27 +2366,16 @@ class LDAP(pykolab.base.Base):
for supported_control in _use_ldap_controls:
try:
- exec("""_results = self.%s(
- %r,
- scope=%r,
- filterstr=%r,
- attrlist=%r,
- attrsonly=%r,
- timeout=%r,
+ _results = getattr(self, supported_control)(
+ base_dn,
+ scope=scope,
+ filterstr=filterstr,
+ attrlist=attrlist,
+ attrsonly=attrsonly,
+ timeout=timeout,
callback=callback,
- primary_domain=%r,
- secondary_domains=%r
- )""" % (
- supported_control,
- base_dn,
- scope,
- filterstr,
- attrlist,
- attrsonly,
- timeout,
- primary_domain,
- secondary_domains
- )
+ primary_domain=primary_domain,
+ secondary_domains=secondary_domains
)
break