[Freeipa-devel] [PATCH] 0032 Fix error message for nonexistent members and add tests.

Tomas Babej tbabej at redhat.com
Mon Nov 24 15:07:28 UTC 2014


On 11/24/2014 01:20 PM, David Kupka wrote:
> On 11/21/2014 04:23 PM, Tomas Babej wrote:
>>
>> On 11/21/2014 04:11 PM, David Kupka wrote:
>>> https://fedorahosted.org/freeipa/ticket/4643
>>>
>>>
>>> _______________________________________________
>>> Freeipa-devel mailing list
>>> Freeipa-devel at redhat.com
>>> https://www.redhat.com/mailman/listinfo/freeipa-devel
>>
>> -                obj.get_dn_if_exists(name)
>> +                try:
>> +                    obj.get_dn(name)
>> +                except errors.NotFound:
>> +                    obj.handle_not_found(*keys)
>>
>> You switched from get_dn_if_exists to get_dn, why? The get_dn method
>> never raises the NotFound error, it just constructs the dn regardless of
>> the fact whether the actual entry at that dn exists.
>>
>> You need to use get_dn_if_exists here. Some negative tests for this
>> would be welcome :).
>>
>> Indeed, by testing the patch:
>>
>> [tbabej at vm-218 ~]$ ipa automember_rebuild --users=doesnotexist
>> --------------------------------------------------------
>> Automember rebuild task finished. Processed (0) entries.
>> --------------------------------------------------------
>>
>> Where the old behaviour was:
>>
>> [tbabej at vm-218 ~]$ ipa automember_rebuild --users=test
>> ipa: ERROR: no such entry
>>
> Thanks for catching this Friday-afternoon brain error.
> Attached patch should work as expected.
>

ACK, works fine.

master:
* b42b1755dcd0a681709525b4d574e12b77bbce13 webui: normalize idview tab
labels
ipa-4-1:
* 2fc53c9426ff976d4732cc1d16b1b61447cb4313 webui: normalize idview tab
labels


-- 
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org 




More information about the Freeipa-devel mailing list