[Freeipa-devel] [PATCH] jderose 007 part1 of limiting param to certain contexts

Jason Gerard DeRose jderose at redhat.com
Tue May 19 20:46:17 UTC 2009


On Tue, 2009-05-19 at 16:15 -0400, Rob Crittenden wrote:
> Jason Gerard DeRose wrote:
> > Both Andrew and Rob have requested the ability to limit a parameter to
> > certain contexts (server, cli, webui, whatever).
> > 
> > I had started work on this a while ago (not all of it ever made it into
> > master), but my previous work only allowed you to specify contexts you
> > wanted a param active in... you couldn't instead specify contexts you
> > *didn't* want a param to be active in.
> > 
> > So this patch removes the Param.limit_to kwarg and adds Param.incude and
> > Param.exclude kwargs.  For example:
> > 
> > Str('webui', include=['webui'])  # Only active when in 'webui' context.
> > 
> > Str('client_only', exclude=['server'])  # All contexts except 'server'
> > 
> > Only the 'include' or 'exclude' kwarg can be specified at once; if you
> > provide both, a ValueError is raised.
> > 
> > This patch also adds a new frontend.UsesParams base class with methods
> > implementing the filtering.  This new functionality doesn't do anything
> > yet till I change Command and Object to subclass from UsesParams, which
> > will come in a separate patch.
> > 
> > Lastly, this patch also includes fairly extensive tests for these new
> > features (UsesParams is at this point tested only through doctests).
> 
> ack

pushed to master.




More information about the Freeipa-devel mailing list