summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-04 15:13:44 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-26 11:16:09 +0100
commitdce9ec73738756d0667647e309966e1728620167 (patch)
tree7e542cbfcf8897bf84f870c39941ce4281f1dd29
parenta7a074685fa4cb03d4e1dffde399459dd847409a (diff)
downloadpykolab-dce9ec73738756d0667647e309966e1728620167.tar.gz
Allow the caller to cache.get_entry() to specify the entry should not be updated automatically
-rw-r--r--pykolab/auth/ldap/cache.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pykolab/auth/ldap/cache.py b/pykolab/auth/ldap/cache.py
index 503c3c5..6688bf7 100644
--- a/pykolab/auth/ldap/cache.py
+++ b/pykolab/auth/ldap/cache.py
@@ -99,12 +99,15 @@ def delete_entry(domain, entry):
db.delete(_entry)
db.commit()
-def get_entry(domain, entry):
+def get_entry(domain, entry, update=True):
result_attribute = conf.get('cyrus-sasl', 'result_attribute')
db = init_db(domain)
_entry = db.query(Entry).filter_by(uniqueid=entry['id']).first()
+ if not update:
+ return _entry
+
if _entry == None:
log.debug(_("Inserting cache entry %r") % (entry['id']), level=8)