summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-24 17:11:28 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-24 17:11:28 +0100
commitf40622f04115f2ecf8547f1dbebe0f88856492fa (patch)
tree1a1ea03ba68efa3212fd04f76fabecce39be965a /pykolab
parentffdafa9008dac20b2c4591321e444bd3cfc85c8f (diff)
downloadpykolab-f40622f04115f2ecf8547f1dbebe0f88856492fa.tar.gz
Allow synchronize() calls to specify to not use persistent searches
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/__init__.py4
-rw-r--r--pykolab/auth/ldap/__init__.py14
2 files changed, 12 insertions, 6 deletions
diff --git a/pykolab/auth/__init__.py b/pykolab/auth/__init__.py
index 359a0f6..6b07549 100644
--- a/pykolab/auth/__init__.py
+++ b/pykolab/auth/__init__.py
@@ -239,8 +239,8 @@ class Auth(pykolab.base.Base):
return domains
- def synchronize(self):
- self._auth.synchronize()
+ def synchronize(self, mode=0):
+ self._auth.synchronize(mode=mode)
def domain_default_quota(self, domain):
return self._auth._domain_default_quota(domain)
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 4a696d9..61ae4a8 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -427,7 +427,6 @@ class LDAP(pykolab.base.Base):
_filter = "%s%s%s" % (__filter_prefix,_filter,__filter_suffix)
-
log.debug(_("Finding resource with filter %r") % (_filter), level=8)
if len(_filter) <= 6:
@@ -515,12 +514,12 @@ class LDAP(pykolab.base.Base):
if _mail_attr == primary_mail_attribute:
log.debug(_("key %r is the prim. mail attr.") % (_mail_attr), level=8)
if not primary_mail == None:
- log.debug(_("prim. mail pol. is not empty"))
+ log.debug(_("prim. mail pol. is not empty"), level=8)
want_attrs.append(_mail_attr)
elif _mail_attr == secondary_mail_attribute:
log.debug(_("key %r is the sec. mail attr.") % (_mail_attr), level=8)
if not secondary_mail == None:
- log.debug(_("sec. mail pol. is not empty"))
+ log.debug(_("sec. mail pol. is not empty"), level=8)
want_attrs.append(_mail_attr)
log.debug(_("Attributes %r are not yet available for entry %r") % (
@@ -838,7 +837,7 @@ class LDAP(pykolab.base.Base):
except:
log.error(_("Could not update dn %r:\n%r") % (dn, modlist))
- def synchronize(self):
+ def synchronize(self, mode=0):
"""
Synchronize with LDAP
"""
@@ -851,6 +850,11 @@ class LDAP(pykolab.base.Base):
log.debug(_("Using filter %r") % (_filter), level=8)
+ if not mode == 0:
+ override_search = mode
+ else:
+ override_search = False
+
self._search(
self.config_get('base_dn'),
filterstr=_filter,
@@ -860,6 +864,7 @@ class LDAP(pykolab.base.Base):
conf.get('cyrus-sasl', 'result_attribute'),
'modifytimestamp'
],
+ override_search=override_search,
callback=self._synchronize_callback,
)
@@ -1886,6 +1891,7 @@ class LDAP(pykolab.base.Base):
primary_domain=None,
secondary_domains=[]
):
+
_results = []
psearch_server_controls = []