]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
describe-tests: handle ParseErrors from any method
authorJosh Durgin <jdurgin@redhat.com>
Thu, 3 Dec 2015 01:30:47 +0000 (17:30 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Wed, 9 Dec 2015 21:04:54 +0000 (13:04 -0800)
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
teuthology/describe_tests.py

index ff18e118f55491a83ba34521d7112c978787d5f8..55e58cee5c19d210b3df4ee35147b62ccb47ec9d 100644 (file)
@@ -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["<suite_dir>"])
     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: