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

Goldwyn Rodrigues rgoldwyn at suse.de
Thu Oct 26 12:26:03 UTC 2017


Hi Christian,

On 10/26/2017 06:55 AM, 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()
> 

Yes, this is what I had in mind.
Reviewed-by: Goldwyn Rodrigues <rgoldwyn at suse.com>

-- 
Goldwyn



More information about the AppArmor mailing list