[apparmor] [patch] Split off logprof_value_or_all()

Steve Beattie steve at nxnw.org
Mon Jan 25 21:51:52 UTC 2016


On Sat, Dec 26, 2015 at 10:51:14PM +0100, Christian Boltz wrote:
> the rule classes have lots of
> 
>         if self.all_foo:
>             foo_txt = _('ALL')
>         else:
>             foo_txt = self.foo
> 
> in logprof_header_localvars().
> 
> To avoid repeating this over and over, split it off to a
> logprof_value_or_all() function.
> 
> This function can handle 
> - str (will be returned unmodified
> - AARE (.regex will be used)
> - sets/lists/tuples (will be ' '.join()ed and sorted)
> 
> Other types are returned unmodified.
> 
> [ 51-split-off-logprof_value_or_all.diff ]

Acked-by: Steve Beattie <steve at nxnw.org>. Thanks!


-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160125/0215ef2c/attachment.pgp>


More information about the AppArmor mailing list