diff options
author | Kevin Hilman <khilman@baylibre.com> | 2017-11-13 20:00:33 +0000 |
---|---|---|
committer | Kevin Hilman <khilman@baylibre.com> | 2017-11-15 21:42:39 +0000 |
commit | 2e31ea39d3232ac219e7f7e582f9da82dfcacd33 (patch) | |
tree | b1e953cd30e56032d1cb0fcabd1479bd128524e3 | |
parent | f52c48bba8b86f7e45bed2b65f6615dbb947468f (diff) |
jjb/common: lava-labs-prepare: catching errors
When no device of the requested device-type is available, abort early
with a useful error message, otherwise job continues and fails in
confusing ways.
Change-Id: I8fdb4160a1ca88d8ba5eb768d70975e9466f696a
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
-rw-r--r-- | jjb/common/include-agl-lava-labs-prepare.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/jjb/common/include-agl-lava-labs-prepare.sh b/jjb/common/include-agl-lava-labs-prepare.sh index b7acd0a6..07e2b5fd 100644 --- a/jjb/common/include-agl-lava-labs-prepare.sh +++ b/jjb/common/include-agl-lava-labs-prepare.sh @@ -46,6 +46,7 @@ lava_device=${arr[0]} releng_device=${arr[1]} # And agl_device=${MACHINE} +device_available=0 for lab in "${!labs[@]}"; do val=${labs[$lab]} OFS=${IFS} @@ -110,3 +111,9 @@ for lab in "${!labs[@]}"; do break fi done + +if [ "$device_available" -eq 0 ]; then + echo "" + echo "ERROR: device not found in any available lab." + exit 1 +fi |