Skip syncing if image_dir does not exist
Devserver should assume no image exists if image_dir is not found.
BUG=chromium:337533
TEST=None
Change-Id: I1fc03a53491711d5d3db6107a1aeaf5102b73b00
Reviewed-on: https://chromium-review.googlesource.com/183543
Reviewed-by: Yu-Ju Hong <yjhong@chromium.org>
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
diff --git a/xbuddy.py b/xbuddy.py
index 27b1deb..a2872b4 100644
--- a/xbuddy.py
+++ b/xbuddy.py
@@ -513,6 +513,11 @@
generated, and xBuddy will clear them from the directory they are in, as
necessary.
"""
+ if not os.path.isdir(self.images_dir):
+ # Skip syncing if images_dir does not exist.
+ _Log('Cannot find %s; skip syncing image registry.', self.images_dir)
+ return
+
build_ids = []
for b in os.listdir(self.images_dir):
# Ensure we have directories to track all boards in build/images