Skip syncing if image_dir does not exist

Devserver should assume no image exists if image_dir is not

This was CL:183543, which was committed but later got lost in the
rebase of other CLs.


Change-Id: I4c06a2661bd5200108e6fe487bb87d3cfd7793ec
Tested-by: Yu-Ju Hong <>
Reviewed-by: Chris Sosa <>
Commit-Queue: Yu-Ju Hong <>
diff --git a/ b/
index b98b744..fb4b553 100644
--- a/
+++ b/
@@ -522,6 +522,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