From 21e27637d3c7027b1558b26d2200774ec5212c8d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 4 Aug 2014 09:07:08 -0700 Subject: [PATCH] suite: fix build_matrix when non-yaml present in % dir First, if we get a non-yaml file, return an empty list. Second, if we are in a % mode, exclude an empty raw result from the combination. Otherwise, we get no resulting jobs. Signed-off-by: Sage Weil --- teuthology/suite.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/teuthology/suite.py b/teuthology/suite.py index 342b719a62..365450dc57 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -560,6 +560,7 @@ def build_matrix(path): if os.path.isfile(path): if path.endswith('.yaml'): return [(None, [path])] + return [] if os.path.isdir(path): files = sorted(os.listdir(path)) if '+' in files: @@ -579,8 +580,9 @@ def build_matrix(path): sublists = [] for fn in files: raw = build_matrix(os.path.join(path, fn)) - sublists.append([(combine_path(fn, item[0]), item[1]) - for item in raw]) + if raw: + sublists.append([(combine_path(fn, item[0]), item[1]) + for item in raw]) out = [] if sublists: for sublist in itertools.product(*sublists): -- 2.39.5