]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
suite: do not calculate product on an empty list (take 2)
authorSage Weil <sage@inktank.com>
Tue, 17 Sep 2013 03:22:09 +0000 (20:22 -0700)
committerSage Weil <sage@inktank.com>
Tue, 17 Sep 2013 03:22:09 +0000 (20:22 -0700)
The original attempt to fix this with dda7954090ccc9ffd8ecd961d6b530a0e6d24964
failed because I screwed up the indentation for the out.append(...) line.

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/suite.py

index 0fc079a495f5df8149903cedcd69241e2f6643c1..89910b1dfe6e7ad74c7c92d49d97fd6bdf488b1a 100644 (file)
@@ -250,12 +250,13 @@ def build_matrix(path):
                 raw = build_matrix(os.path.join(path, fn))
                 sublists.append([(combine_path(fn, item[0]), item[1]) for item in raw])
             out = []
-            for sublist in itertools.product(*sublists):
-                name = '{' + ' '.join([item[0] for item in sublist]) + '}'
-                val = []
-                for item in sublist:
-                    val.extend(item[1])
-                out.append((name, val))
+            if sublists:
+                for sublist in itertools.product(*sublists):
+                    name = '{' + ' '.join([item[0] for item in sublist]) + '}'
+                    val = []
+                    for item in sublist:
+                        val.extend(item[1])
+                    out.append((name, val))
             return out
         else:
             # list items