Skip syncing if image_dir does not exist
Devserver should assume no image exists if image_dir is not
found.
This was CL:183543, which was committed but later got lost in the
rebase of other CLs.
BUG=chromium:337533
TEST=None
Change-Id: I4c06a2661bd5200108e6fe487bb87d3cfd7793ec
Reviewed-on: https://chromium-review.googlesource.com/195214
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
diff --git a/xbuddy.py b/xbuddy.py
index b98b744..fb4b553 100644
--- a/xbuddy.py
+++ b/xbuddy.py
@@ -522,6 +522,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