mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00:00
drop dead code from tools.py
tools.py act() is only used by aa-cleanprof, therefore the else branch (self.name != cleanprof) never gets used. This patch drops the dead code and renames act() to cleanprof_act() to make it clear that only aa-cleanprof calls this function. Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
parent
b289f0928e
commit
673be01cdc
@ -33,4 +33,4 @@ args = parser.parse_args()
|
|||||||
|
|
||||||
clean = apparmor.tools.aa_tools('cleanprof', args)
|
clean = apparmor.tools.aa_tools('cleanprof', args)
|
||||||
|
|
||||||
clean.act()
|
clean.cleanprof_act()
|
||||||
|
@ -84,7 +84,7 @@ class aa_tools:
|
|||||||
|
|
||||||
yield (program, profile)
|
yield (program, profile)
|
||||||
|
|
||||||
def act(self):
|
def cleanprof_act(self):
|
||||||
# used by aa-cleanprof
|
# used by aa-cleanprof
|
||||||
apparmor.read_profiles()
|
apparmor.read_profiles()
|
||||||
|
|
||||||
@ -100,20 +100,7 @@ class aa_tools:
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if program and apparmor.profile_exists(program):
|
if program and apparmor.profile_exists(program):
|
||||||
if self.name == 'cleanprof':
|
self.clean_profile(program)
|
||||||
self.clean_profile(program)
|
|
||||||
|
|
||||||
else:
|
|
||||||
filename = apparmor.get_profile_filename(program)
|
|
||||||
|
|
||||||
if not os.path.isfile(filename) or apparmor.is_skippable_file(filename):
|
|
||||||
aaui.UI_Info(_('Profile for %s not found, skipping') % program)
|
|
||||||
|
|
||||||
else:
|
|
||||||
# One simply does not walk in here!
|
|
||||||
raise apparmor.AppArmorException('Unknown tool: %s' % self.name)
|
|
||||||
|
|
||||||
self.reload_profile(profile)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if '/' not in program:
|
if '/' not in program:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user