From 710d5ae466d76ff9a3ea8cefb7e7838ad7cd0417 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 10 May 2020 23:49:16 +0200 Subject: [PATCH] Drop is_active_profile() ... and inline it at the only place that uses it --- utils/apparmor/aa.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index 159a9b9ce..fed7327b9 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -1476,7 +1476,7 @@ def do_logprof_pass(logmark=''): def save_profiles(): # Ensure the changed profiles are actual active profiles for prof_name in changed.keys(): - if not is_active_profile(prof_name): + if not aa.get(prof_name, False): print("*** save_profiles(): removing %s" % prof_name) print('*** This should not happen. Please open a bugreport!') changed.pop(prof_name) @@ -2151,12 +2151,6 @@ def separate_vars(vs): return data -def is_active_profile(pname): - if aa.get(pname, False): - return True - else: - return False - def store_list_var(var, list_var, value, var_operation, filename): """Store(add new variable or add values to variable) the variables encountered in the given list_var - the 'var' parameter will be modified