From 43920b20672cd603f7d5e02544a951eec914636b Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 12 Mar 2019 17:29:20 +0300 Subject: [PATCH] Improve the final result output Refers to issue #13. --- kconfig-hardened-check.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index 5ef937c..64f6efb 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -423,13 +423,11 @@ if __name__ == '__main__': construct_checklist(arch) check_config_file(args.config) error_count = len(list(filter(lambda opt: opt.result and opt.result.startswith('FAIL'), checklist))) + ok_count = len(list(filter(lambda opt: opt.result and opt.result.startswith('OK'), checklist))) if debug_mode: sys.exit(0) - if error_count == 0: - print('[+] config check is PASSED') - sys.exit(0) - else: - sys.exit('[-] config check is NOT PASSED: {} errors'.format(error_count)) + print('[+] config check is finished: \'OK\' - {} / \'FAIL\' - {}'.format(ok_count, error_count)) + sys.exit(0) if args.print: arch = args.print -- 2.31.1