xbuddy: ignore files in build dir

If you happen to create a file in src/build/images/ (for debugging or
whatever), xbuddy crashes:
$ cros flash usb:// xbuddy://remote/eve/latest-stable/recovery
...
19:12:20: ERROR: cros flash failed before completing.
cros: Unhandled exception:
Traceback (most recent call last):
  File ".../chromite/bin/cros", line 169, in <module>
    DoMain()
  ...more uninteresting chromite frames...
  File ".../chromite/lib/dev_server_wrapper.py", line 156, in GetImagePathWithXbuddy
    build_id, file_name = xb.Get(path_list)
  File ".../src/platform/dev/xbuddy.py", line 938, in Get
    self._SyncRegistryWithBuildImages()
  File ".../src/platform/dev/xbuddy.py", line 671, in _SyncRegistryWithBuildImages
    in os.listdir(board_dir) if not v == LATEST])
OSError: [Errno 20] Not a directory: '.../src/build/images/log'

Update the loop to ignore non-directories in here.

BUG=None
TEST=`cros flash` no longer fails

Change-Id: I4e3c99d091d2def28196d5e941b38d82a4c65b15
Reviewed-on: https://chromium-review.googlesource.com/798896
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
1 file changed