summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-29 13:48:44 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-29 13:48:44 +0200
commit2001494a7dfebe9a1b1bc0e4725b6449cf0ca34f (patch)
tree32c7fd7d3a38425b0cf3a8c4bed6773bdace4098 /pykolab
parent28ae1b011a59eac48989d01928879af5ca0de6a5 (diff)
downloadpykolab-2001494a7dfebe9a1b1bc0e4725b6449cf0ca34f.tar.gz
Try using one supported control, and abort the entire synchronization if it succeeds. If the configured control does not succeed, try the next supported control
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/ldap/__init__.py48
1 files changed, 27 insertions, 21 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 54e231d..6eda75a 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -2394,27 +2394,33 @@ class LDAP(pykolab.base.Base):
_use_ldap_controls = self.ldap.supported_controls
for supported_control in _use_ldap_controls:
- exec("""_results = self.%s(
- %r,
- scope=%r,
- filterstr=%r,
- attrlist=%r,
- attrsonly=%r,
- timeout=%r,
- callback=callback,
- primary_domain=%r,
- secondary_domains=%r
- )""" % (
- supported_control,
- base_dn,
- scope,
- filterstr,
- attrlist,
- attrsonly,
- timeout,
- primary_domain,
- secondary_domains
+ try:
+ exec("""_results = self.%s(
+ %r,
+ scope=%r,
+ filterstr=%r,
+ attrlist=%r,
+ attrsonly=%r,
+ timeout=%r,
+ callback=callback,
+ primary_domain=%r,
+ secondary_domains=%r
+ )""" % (
+ supported_control,
+ base_dn,
+ scope,
+ filterstr,
+ attrlist,
+ attrsonly,
+ timeout,
+ primary_domain,
+ secondary_domains
+ )
)
- )
+
+ break
+
+ except:
+ continue
return _results