On Sun, Jun 25, 2017 at 10:49:55AM +0200, Christian Boltz wrote: > Hello, > > 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. > > > [ 01-tools-dead-code.diff ]
Acked-by: Seth Arnold <[email protected]> Acked for trunk Thanks > > === modified file ./utils/aa-cleanprof > --- utils/aa-cleanprof 2016-10-01 21:00:58.949770000 +0200 > +++ utils/aa-cleanprof 2017-06-25 10:39:44.811697668 +0200 > @@ -33,4 +33,4 @@ > > clean = apparmor.tools.aa_tools('cleanprof', args) > > -clean.act() > +clean.cleanprof_act() > === modified file ./utils/apparmor/tools.py > --- utils/apparmor/tools.py 2017-06-25 10:39:24.039817320 +0200 > +++ utils/apparmor/tools.py 2017-06-25 10:39:33.399763247 +0200 > @@ -84,7 +84,7 @@ > > yield (program, profile) > > - def act(self): > + def cleanprof_act(self): > # used by aa-cleanprof > apparmor.read_profiles() > > @@ -100,20 +100,7 @@ > sys.exit(1) > > if program and apparmor.profile_exists(program): > - if self.name == 'cleanprof': > - 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) > + self.clean_profile(program) > > else: > if '/' not in program: > > >
signature.asc
Description: PGP signature
-- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
