~apparmor-dev/apparmor/master

« back to all changes in this revision

Viewing changes to utils/apparmor/ui.py

  • Committer: Christian Boltz
  • Date: 2017-10-26 16:49:32 UTC
  • Revision ID: apparmor@cboltz.de-20171026164932-8k5fyn1vcl1tck34
Keep JSON version at 2.12

We never did a release with the JSON code, and YaST (the only known user
of the JSON interface) will work with the added 'changes' dialog type
from r3721 without needing changes.

Also add a better comment/reason why a response for 'changes' is
expected, but gets ignored.


Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Acked-by: Steve Beattie <steve@nxnw.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
def set_json_mode():
46
46
    global UI_mode
47
47
    UI_mode = 'json'
48
 
    jsonout = {'dialog': 'apparmor-json-version', 'data': '2.13'}
 
48
    jsonout = {'dialog': 'apparmor-json-version', 'data': '2.12'}
49
49
    write_json(jsonout)
50
50
 
51
51
# reads the response on command line for json and verifies the response
257
257
    if UI_mode == 'json':
258
258
        jsonout = {'dialog': 'changes', 'header':header, 'filename': difftemp.name}
259
259
        write_json(jsonout)
260
 
        json_response('changes')["response"]  # response gets ignored, therefore not assigning to a variable
 
260
        json_response('changes')["response"]  # wait for response to delay deletion of difftemp (and ignore response content)
261
261
    else:
262
262
      subprocess.call('less %s' % difftemp.name, shell=True)
263
263
    difftemp.close()