Comments (4)
Comment #1 originally posted by jaqx0r on 2008-08-11T01:05:02.000Z:
Well I agree that we can do a better job of handling the LDAP error, but if all the
LDAP module is telling us is that there's no such object in the dc=mycompany,dc=com
tree, then there's not a lot of interpretation that we can put on top of it.
I think the fix for this specific error is to catch the NO_SUCH_OBJECT and tell you
what we were trying to look up, and perhaps with a more elegant failure than dumping
the traceback :)
from nsscache.
Comment #2 originally posted by jaqx0r on 2013-07-01T13:58:04.000Z:
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)
from nsscache.
Comment #3 originally posted by jaqx0r on 2013-07-30T09:30:29.000Z:
I've decided to fix the latter issue by testing for None in WriteMOdifyTimestamp, and exiting early; there are three call sites in map_updater.py that need the test so it makes sense to put it inside the method.
from nsscache.
Comment #4 originally posted by jaqx0r on 2013-07-30T09:33:59.000Z:
This issue was closed by revision 08267c1d0d02.
from nsscache.
Related Issues (20)
- nsscache doesn't map all members of a group HOT 2
- reformat by removing error E713 for membership test HOT 7
- ShadowExpire == -1 HOT 1
- sshkey map fails to import HOT 4
- Not all LDAP servers provide LastModification Dates
- bsddb3 is deprecated HOT 3
- `uidattr` ignored when writing out groups
- mox3 archived & deprecated upstream, please update tests to not use it HOT 3
- Does not work offline. HOT 6
- Question: Merge groups with the same ids
- Add support for GCS source HOT 1
- skip the unexcepted line in the cache file
- Please support nested groups HOT 11
- Tagging of versions HOT 3
- nsscache doesn't update group cache from ldap source HOT 7
- ConfigParser.NoSectionError: No section: 'suffix' with nsscache >= 0.36 HOT 2
- configure nsscache with samba4 active directory HOT 31
- is nsscache python3 compatible? HOT 25
- Get integration tests running in CI HOT 37
- Properly define byte vs string types in source and cache api boundaries
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsscache.