Comment #2 on issue 13 by
albi...@gmail.com: More robust LDAP error handling
http://code.google.com/p/nsscache/issues/detail?id=13
I think catching this error should lead to the returning of the empty set,
so I've fixed it this way
(The comment is that it looked before)
nss_cache/sources/ldapsource.py:
# result_type, data = self.conn.result(self.message_id, all=0,
# timeout=self.conf['timelimit'])
try:
result_type, data = self.conn.result(self.message_id, all=0,
timeout=self.conf['timelimit'])
except ldap.NO_SUCH_OBJECT:
self.log.debug('Returning due to ldap.NO_SUCH_OBJECT')
return
After that I've caught another error, which seems like a small bug to me:
Traceback (most recent call last):
File "/opt/lxc/manage/scripts/nsscache/nsscache", line 33, in <module>
return_value = nsscache_app.Run(sys.argv[1:], os.environ)
File "/opt/lxc/manage/scripts/nsscache/nss_cache/app.py", line 242, in Run
retval = command_callable().Run(conf=conf, args=args)
File "/opt/lxc/manage/scripts/nsscache/nss_cache/command.py", line 235,
in Run
force_lock=options.force_lock)
File "/opt/lxc/manage/scripts/nsscache/nss_cache/command.py", line 308,
in UpdateMaps
force_write=force_write)
File "/opt/lxc/manage/scripts/nsscache/nss_cache/update/updater.py", line
256, in UpdateFromSource
force_write, location=None)
File "/opt/lxc/manage/scripts/nsscache/nss_cache/update/map_updater.py",
line 79, in UpdateCacheFromSource
return_val += self.FullUpdateFromMap(cache, source_map, force_write)
File "/opt/lxc/manage/scripts/nsscache/nss_cache/update/map_updater.py",
line 148, in FullUpdateFromMap
self.WriteModifyTimestamp(new_map.GetModifyTimestamp())
File "/opt/lxc/manage/scripts/nsscache/nss_cache/update/updater.py", line
231, in WriteModifyTimestamp
return self._WriteTimestamp(timestamp, self.modify_file)
File "/opt/lxc/manage/scripts/nsscache/nss_cache/update/updater.py", line
165, in _WriteTimestamp
time_string = time.strftime('%Y-%m-%dT%H:%M:%SZ', timestamp)
TypeError: argument must be 9-item sequence, not None
Since it's stated everywhere, that timestamp can be None, I think it should
be fixed in nss_cache/update/map_updater.py(line 165) this way:
# self.WriteModifyTimestamp(new_map.GetModifyTimestamp())
modify_timestamp = new_map.GetModifyTimestamp()
if not modify_timestamp is None:
self.WriteModifyTimestamp(modify_timestamp)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings