when using grep + tr to find board availability, status, a race
condition happens sometimes. When it happens the job is stuck and
timeout fails.
Fix it by calling sequentially grep then tr and not piping.
Change-Id: Ib1322e280900b62abdd827992b42183024cd094c
Signed-off-by: Loys Ollivier <lollivier@baylibre.com>
lava-tool job-details $full_url $job_id | tee $JOB_STATUS
IFS=':'
-line=$(grep "^status:" $JOB_STATUS | tr -d '[:space:]')
+line=$(grep "^status:" $JOB_STATUS)
+line=$(echo "$line" | tr -d '[:space:]')
arr=($line)
status=${arr[1]}
IFS=${OFS}
# Find the LAVA Lab that has the device available to run the job
echo -n "Checking for $lava_device at $full_url... "
- line=$(lava-tool devices-list $full_url |grep $lava_device | tr -d '[:space:]')
+ line=$(lava-tool devices-list $full_url | grep $lava_device)
+ line=$(echo "$line" | tr -d '[:space:]')
+
if [ -z "$line" ]; then
echo "not found."
continue