[Freeipa-devel] [PATCH] 1013 implement permission/aci find by subtree

Rob Crittenden rcritten at redhat.com
Mon May 14 21:45:59 UTC 2012


Martin Kosek wrote:
> On Fri, 2012-05-11 at 16:34 -0400, Rob Crittenden wrote:
>> permission-find --subtree wasn't implemented so always returned all
>> entries (the option was ignored).
>>
>> rob
>
> I found the following 2 issues:
>
> 1) The following piece of code is over-complicated:
>
> +                found = False
> +                if kw['subtree'] == target:
> +                    found = True
> +                if not found:
> +                    try:
> +                        results.remove(a)
> +                    except ValueError:
> +                        pass
>
> This would simpler and more readable:
> +                if kw['subtree'] != target:
> +                    try:
> +                        results.remove(a)
> +                    except ValueError:
> +                        pass
>
> 2) I know we don't validate the subtree expression, but I wonder if we
> shouldn't make the subtree comparing at least case insensitive as DN is
> also not case sensitive.
>
> Martin
>

Yeah, much simpler. Fixed both.

rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-rcrit-1013-2-subtree.patch
Type: text/x-diff
Size: 3663 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120514/a043e8d8/attachment.bin>


More information about the Freeipa-devel mailing list