From 0219f5537c874fe92529cca26b8ee52b686489d5 Mon Sep 17 00:00:00 2001 From: lollivier Date: Thu, 30 Nov 2017 10:56:54 +0100 Subject: jjb/common/lava-labs-prepare: LAVA fail gracefully if device not found When LAVA labs are offline, or otherwise unavailable, "lava-tool devices-list" fails causing the whole job to fail. Detect this error earlier when trying to add the authentication and skip the lab if offline. If the device was not found in any lab, exit with success. JIRA: SPEC-1142 Change-Id: Ia2cdeea3da8ade7feb5962e0898f40e59ca9cfdb Signed-off-by: lollivier --- jjb/common/include-agl-lava-labs-prepare.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jjb/common/include-agl-lava-labs-prepare.sh b/jjb/common/include-agl-lava-labs-prepare.sh index 3c0c73a3..aab5eb3d 100644 --- a/jjb/common/include-agl-lava-labs-prepare.sh +++ b/jjb/common/include-agl-lava-labs-prepare.sh @@ -81,6 +81,7 @@ for lab in "${!labs[@]}"; do lava-tool auth-add --token $token_file $full_url if [ $? != 0 ]; then echo "ERROR: Lab ${lab}: lava-tool auth-add failed." + continue fi rm -f $token_file @@ -117,5 +118,5 @@ done if [ "$device_available" -eq 0 ]; then echo "" echo "ERROR: device not found in any available lab." - exit 1 + exit 0 fi -- cgit 1.2.3-korg