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

Rob Crittenden rcritten at redhat.com
Tue May 19 20:15:23 UTC 2009


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20090519/459976c6/attachment.bin>


More information about the Freeipa-devel mailing list