From 38cdaa1f6ad6b2f1f96638dd5dfaa960a7572e54 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 14 Oct 2016 20:24:10 +0200 Subject: [PATCH] Drop seen_events counter from aa.py seen_events is a global variable in aa.py that gets increased at several places, but isn't used (read or printed) anywhere. Since I can't imagine how it could become useful, simply drop it. Also drop an outdated comment in handle_children that lived next to a seen_events line. Acked-by: Seth Arnold --- utils/apparmor/aa.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index 3aded1c53..51a0cb90b 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -95,7 +95,6 @@ include = dict() existing_profiles = dict() -seen_events = 0 # was our # To store the globs entered by users so they can be provided again # format: user_globs['/foo*'] = AARE('/foo*') user_globs = {} @@ -1030,7 +1029,6 @@ def handle_children(profile, hat, root): family = None sock_type = None protocol = None - global seen_events regex_nullcomplain = re.compile('^null(-complain)*-profile$') for entry in entries: @@ -1088,8 +1086,6 @@ def handle_children(profile, hat, root): if aamode == 'PERMITTING': q.default = 'CMD_ADDHAT' - seen_events += 1 - ans = q.promptUser()[0] if ans == 'CMD_FINISHED': @@ -1257,9 +1253,6 @@ def handle_children(profile, hat, root): exec_toggle = False q.functions += build_x_functions(default, options, exec_toggle) - # options = '|'.join(options) - seen_events += 1 - # ask user about the exec mode to use ans = '' while ans not in ['CMD_ix', 'CMD_px', 'CMD_cx', 'CMD_nx', 'CMD_pix', 'CMD_cix', 'CMD_nix', 'CMD_ux', 'CMD_DENY']: # add '(I)gnore'? (hotkey conflict with '(i)x'!) @@ -1495,7 +1488,6 @@ def order_globs(globs, original_path): def ask_the_questions(): found = 0 - global seen_events for aamode in sorted(log_dict.keys()): # Describe the type of changes if aamode == 'PERMITTING': @@ -1550,8 +1542,6 @@ def ask_the_questions(): else: options.append(rule_obj.get_clean()) - seen_events += 1 - done = False while not done: q.options = options