cros_build_lib: Add strict to GetBoard()
Exits with an error message when the board is not specified and a
default board does not exist when strict is true.
BUG=chromium:968169
TEST=manual
Change-Id: I072c5b55b7204582c97a847f5c5da2a1ec728205
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1718831
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Commit-Queue: Eashan Bhatt <eashanbhatt@google.com>
Tested-by: Eashan Bhatt <eashanbhatt@google.com>
diff --git a/cli/flash.py b/cli/flash.py
index 99eab41..0bba664 100644
--- a/cli/flash.py
+++ b/cli/flash.py
@@ -422,9 +422,8 @@
# Assuming it is an xbuddy path.
self.board = cros_build_lib.GetBoard(device_board=device.board,
override_board=self.board,
- force=self.yes)
- if not self.board:
- raise FlashError('No board identified.')
+ force=self.yes,
+ strict=True)
if not self.force and self.board != device.board:
# If a board was specified, it must be compatible with the device.
raise FlashError('Device (%s) is incompatible with board %s' %