From 31479dee3702426dc67c2aef92e4f3d88364e830 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Wed, 2 Dec 2015 17:30:47 -0800 Subject: [PATCH] describe-tests: handle ParseErrors from any method Signed-off-by: Josh Durgin --- teuthology/describe_tests.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/teuthology/describe_tests.py b/teuthology/describe_tests.py index ff18e118f5..55e58cee5c 100644 --- a/teuthology/describe_tests.py +++ b/teuthology/describe_tests.py @@ -11,6 +11,12 @@ from teuthology.exceptions import ParseError from teuthology.suite import build_matrix, combine_path def main(args): + try: + describe_tests(args) + except ParseError: + sys.exit(1) + +def describe_tests(args): suite_dir = os.path.abspath(args[""]) fields = args["--fields"].split(',') include_facet = args['--show-facet'] == 'yes' @@ -133,11 +139,8 @@ def get_combinations(suite_dir, fields, subset, for row in rows]) def describe_suite(suite_dir, fields, include_facet, output_format): - try: - rows = tree_with_info(suite_dir, fields, include_facet, '', [], - output_format=output_format) - except ParseError: - return 1 + rows = tree_with_info(suite_dir, fields, include_facet, '', [], + output_format=output_format) headers = ['path'] if include_facet: -- 2.39.5