fix bad reading of options in ldapuser.py oldstable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Tue, 04 May 2010 12:05:00 +0200
brancholdstable
changeset 5455 3dc47a52dd19
parent 5441 9ffda7b0d772
child 5456 d040889fac4e
child 5469 4746c157e5e4
fix bad reading of options in ldapuser.py time related options have type time and not int, so use the proper function to handle conversions
server/sources/ldapuser.py
--- a/server/sources/ldapuser.py	Thu Apr 29 14:34:13 2010 +0200
+++ b/server/sources/ldapuser.py	Tue May 04 12:05:00 2010 +0200
@@ -44,6 +44,7 @@
 from ldap.filter import filter_format, escape_filter_chars
 from ldapurl import LDAPUrl
 
+from logilab.common.configuration import time_validator
 from cubicweb import AuthenticationError, UnknownEid, RepositoryError
 from cubicweb.server.utils import cartesian_product
 from cubicweb.server.sources import (AbstractSource, TrFunc, GlobTrFunc,
@@ -186,9 +187,11 @@
                               for o in self.user_classes]
         self._conn = None
         self._cache = {}
-        ttlm = int(source_config.get('cache-life-type', 2*60))
+        ttlm = time_validator(None, None,
+                              source_config.get('cache-life-time', 2*60))
         self._query_cache = TimedCache(ttlm)
-        self._interval = int(source_config.get('synchronization-interval',
+        self._interval = time_validator(None, None,
+                                        source_config.get('synchronization-interval',
                                                24*60*60))
 
     def reset_caches(self):