[Autotest] work around keyerror for results
This is a workaround but the error is not fatal and the
main purpose was to avoid having an error in the provisioning logs that
confuses people debugging tests.
Sometimes, for a TBD reason, the results do not have the utils_lib.DIRS
yet.
BUG=b:181691434
TEST=dummy_Pass/cq
Change-Id: Idd8f418d8d1e45be3ad909ab770dd425de4cfc90
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2779813
Tested-by: Derek Beckett <dbeckett@chromium.org>
Auto-Submit: Derek Beckett <dbeckett@chromium.org>
Commit-Queue: Derek Beckett <dbeckett@chromium.org>
Reviewed-by: Keith Haddow <haddowk@chromium.org>
diff --git a/client/bin/result_tools/result_info.py b/client/bin/result_tools/result_info.py
index 312d3b6..de75afb 100644
--- a/client/bin/result_tools/result_info.py
+++ b/client/bin/result_tools/result_info.py
@@ -143,7 +143,6 @@
@param parent_dir: Path to the parent directory.
@param name: Name of the result file or directory.
"""
- assert name != None
self._name = name
# Dictionary to store details of the given path is set to a keyval of
@@ -440,6 +439,8 @@
@param original_info: A dictionary of the file's size and sub-directory
information.
"""
+ if utils_lib.DIRS not in self.details:
+ self.details[utils_lib.DIRS] = []
self.details[utils_lib.DIRS].append(
ResultInfo(parent_dir=self._path,
name=name,