Skip syncing if image_dir does not exist

Devserver should assume no image exists if image_dir is not found.


Change-Id: I1fc03a53491711d5d3db6107a1aeaf5102b73b00
Reviewed-by: Yu-Ju Hong <>
Tested-by: Yu-Ju Hong <>
Commit-Queue: Yu-Ju Hong <>
diff --git a/ b/
index 27b1deb..a2872b4 100644
--- a/
+++ b/
@@ -513,6 +513,11 @@
     generated, and xBuddy will clear them from the directory they are in, as
+    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