--- utils/apparmor/aa.py 2017-10-11 21:20:00.789641479 +0200 +++ utils/apparmor/aa.py 2017-10-22 14:15:00.412193634 +0200 @@ -1827,16 +1827,18 @@ if not changed: return - q.options = sorted(changed.keys()) + options = sorted(changed.keys()) + q.options = options ans, arg = q.promptUser() + + which = options[arg] + if ans == 'CMD_SAVE_SELECTED': - profile_name = list(changed.keys())[arg] - write_profile_ui_feedback(profile_name) - reload_base(profile_name) + write_profile_ui_feedback(which) + reload_base(which) elif ans == 'CMD_VIEW_CHANGES': - which = list(changed.keys())[arg] oldprofile = None if aa[which][which].get('filename', False): oldprofile = aa[which][which]['filename'] @@ -1852,7 +1854,6 @@ display_changes_with_comments(oldprofile, newprofile) elif ans == 'CMD_VIEW_CHANGES_CLEAN': - which = list(changed.keys())[arg] oldprofile = serialize_profile(original_aa[which], which, '') newprofile = serialize_profile(aa[which], which, '')