[apparmor] [PATCH 2/2] Add JSON interface to UI_Changes

Steve Beattie steve at nxnw.org
Thu Oct 26 14:49:32 UTC 2017


On Thu, Oct 26, 2017 at 01:55:17PM +0200, Christian Boltz wrote:
> Hello,
> 
> Am Donnerstag, 26. Oktober 2017, 13:50:20 CEST schrieb Christian Boltz:
> > +        json_response('changes')["response"]  # wait for it to delay deletion of difftemp (and ignore response content)
> 
> That's what I get for rewording the comment -   s/ it / response /
> so v2 of this simple patch is:
> 
> 
> === modified file 'utils/apparmor/ui.py'
> --- utils/apparmor/ui.py        2017-10-25 22:36:48 +0000
> +++ utils/apparmor/ui.py        2017-10-26 11:52:45 +0000
> @@ -45,7 +45,7 @@
>  def set_json_mode():
>      global UI_mode
>      UI_mode = 'json'
> -    jsonout = {'dialog': 'apparmor-json-version', 'data': '2.13'}
> +    jsonout = {'dialog': 'apparmor-json-version', 'data': '2.12'}
>      write_json(jsonout)
>  
>  # reads the response on command line for json and verifies the response
> @@ -257,7 +257,7 @@
>      if UI_mode == 'json':
>          jsonout = {'dialog': 'changes', 'header':header, 'filename': difftemp.name}
>          write_json(jsonout)
> -        json_response('changes')["response"]  # response gets ignored, therefore not assigning to a variable
> +        json_response('changes')["response"]  # wait for response to delay deletion of difftemp (and ignore response content)
>      else:
>        subprocess.call('less %s' % difftemp.name, shell=True)
>      difftemp.close()

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: 801 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20171026/9e2d25ce/attachment.sig>


More information about the AppArmor mailing list