cleanup aa-disable handling in tools.py

Remove the check if the disable directory exists. If it's really
missing, it will be auto-created by create_symlink(), so we
automagically fix things instead of annoying the user with an
error message ;-)

Acked-by: Steve Beattie <steve@nxnw.org> for both trunk and 2.9.
This commit is contained in:
Christian Boltz 2015-02-28 00:25:45 +01:00
parent 67dae2f1cf
commit 34f2c1c6ea

View file

@ -32,9 +32,6 @@ class aa_tools:
if tool_name in ['audit']:
self.remove = args.remove
elif tool_name == 'disable':
self.disabledir = apparmor.profile_dir + '/disable'
self.check_disable_dir()
elif tool_name == 'autodep':
self.force = args.force
self.aa_mountpoint = apparmor.check_for_apparmor()
@ -50,10 +47,6 @@ class aa_tools:
if not user_perm(apparmor.profile_dir):
raise apparmor.AppArmorException("Cannot write to profile directory: %s" % (apparmor.profile_dir))
def check_disable_dir(self):
if not os.path.isdir(self.disabledir):
raise apparmor.AppArmorException("Can't find AppArmor disable directory %s" % self.disabledir)
def get_next_to_profile(self):
'''Iterator function to walk the list of arguments passed'''