Add some more slack to the parser when dealing with multi-machine
jobs. If the job isn't neatly broken down into machine-specific
subjobs, just accept it and use the set of hostnames as the
"hostname". This should allow us to do meaningful parsing of
multi-machine test results, even if things aren't as intelligent
as we'd like.
Risk: Low
Visibility: Doesn't affect the parsing of anything that the parser can
currently handle; allows us to do SOME parsing of generic
multi-machine results.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2720 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/parse.py b/tko/parse.py
index 4146029..3d5a91f 100755
--- a/tko/parse.py
+++ b/tko/parse.py
@@ -134,7 +134,11 @@
# if there's a .machines file, use it to get the subdirs
machine_list = os.path.join(path, ".machines")
if os.path.exists(machine_list):
- return set(line.strip() for line in file(machine_list))
+ subdirs = set(line.strip() for line in file(machine_list))
+ existing_subdirs = set(subdir for subdir in subdirs
+ if os.path.exists(os.path.join(path, subdir)))
+ if len(existing_subdirs) != 0:
+ return existing_subdirs
# if this dir contains ONLY subdirectories, return them
contents = set(os.listdir(path))