[Freeipa-devel] [PATCH] Provide more detailed NotFound error messages from baseldap.py classes.

Rob Crittenden rcritten at redhat.com
Fri Mar 5 21:58:46 UTC 2010


Pavel Zuna wrote:
> Pavel Zuna wrote:
>> We talked about this on yesterdays quick server call.
>>
>> Here's what the messages look like:
>>
>> # ipa user-show idontexist
>> ipa: ERROR: idontexist: user not found
>>
>> # ipa group-show idontexist
>> ipa: ERROR: idontexist: group not found
>>
>> # ipa automountmap-add idontexist somemap
>> ipa: ERROR: idontexist: automount location not found
>>
>> All subclasses of LDAPObject can override these of course. And no, 
>> it's not hardcoded for 'idontexist'. :)
>>
>> Pavel
> Oups, accidentally left some debugging output in there, sorry. :) New 
> patch attached.
> 
> Pavel

I don't think the try/except in LDAPUpdate around ldap.get_entry() after 
the record has been updated is quite right. I guess it is probably a 
good idea to catch it but if it is not found it means that the entry was 
deleted after successfully updating it but before we could pull it again 
to display it. To be honest, I'm not sure >what< we should do here, but 
I'm not sure NotFound is the right thing :-)

This seems like a mid-air collision. I wonder if we should add a special 
exception for this. Not sure what the user would do with it but we 
should warn them at least.

rob




More information about the Freeipa-devel mailing list