diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index 42ef41ac6..c865a20d2 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -1823,16 +1823,18 @@ def save_profiles(): 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'] @@ -1848,7 +1850,6 @@ def save_profiles(): aaui.UI_Changes(oldprofile, newprofile, comments=True) elif ans == 'CMD_VIEW_CHANGES_CLEAN': - which = list(changed.keys())[arg] oldprofile = serialize_profile(original_aa[which], which, '') newprofile = serialize_profile(aa[which], which, '')