From df12e87fb54332467120f94e497ea40d8dd06a2b Mon Sep 17 00:00:00 2001 From: Tyler Hicks Date: Wed, 16 Dec 2015 16:12:59 -0600 Subject: [PATCH] utils: Use apparmor.fail for AppArmorException handling in aa-easyprof Don't catch AppArmorExceptions in aa-easyprof any longer and rely on apparmor.fail to print the exception to stderr. Signed-off-by: Tyler Hicks Acked-by: Christian Boltz --- utils/aa-easyprof | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/utils/aa-easyprof b/utils/aa-easyprof index 93861aefb..88d1f92f9 100755 --- a/utils/aa-easyprof +++ b/utils/aa-easyprof @@ -10,7 +10,7 @@ # ------------------------------------------------------------------ import apparmor.easyprof -from apparmor.easyprof import AppArmorException, error +from apparmor.easyprof import error import os import sys @@ -61,12 +61,7 @@ if __name__ == "__main__": for (binary, options) in profiles: if len(profiles) > 1: count += 1 - try: - easyp = apparmor.easyprof.AppArmorEasyProfile(binary, options) - except AppArmorException as e: - error(e.value) - except Exception: - raise + easyp = apparmor.easyprof.AppArmorEasyProfile(binary, options) if options.list_templates: apparmor.easyprof.print_basefilenames(easyp.get_templates()) @@ -118,7 +113,4 @@ if __name__ == "__main__": sys.stdout.write('%s\n' % easyp.gen_manifest(params)) else: params['no_verify'] = options.no_verify - try: - easyp.output_policy(params, count, opt.output_directory) - except AppArmorException as e: - error(e) + easyp.output_policy(params, count, opt.output_directory)