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

Martin Kosek mkosek at redhat.com
Tue May 15 06:56:38 UTC 2012


On Mon, 2012-05-14 at 17:45 -0400, Rob Crittenden wrote:
> 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

ACK. Pushed to master.

Martin




More information about the Freeipa-devel mailing list