Prevent errors due to non-existing console.html

Grep and stat were producing the error "No such file or directory"
while the consoleLog was not available to download. Keeping an empty
/tmp/console.html resolves the problem. It's also possible to debug any
possible issues with curl and grep independently since curl would
report 404 for missing url and a new error message was introduced
for missing UUID after the max retries.

Change-Id: Icb28bfca96e5eaff725d2efcfb47c3399e3991c4
This commit is contained in:
Rafael Folco 2015-10-07 09:58:33 -05:00 committed by Mikhail S Medvedev
parent cded74082b
commit 680f3c73b2

View File

@ -7,8 +7,8 @@ END_UUID=$(cat /proc/sys/kernel/random/uuid)
echo "Grabbing consoleLog ($END_UUID)"
# Since we are appending to fetched logs, remove any possibly old runs
rm -f /tmp/console.html
# Since we are appending to fetched logs, clear any possibly old runs
echo > /tmp/console.html
# Grab the HTML version of the log (includes timestamps)
TRIES=0
@ -16,6 +16,7 @@ console_log_path='logText/progressiveHtml'
while ! grep -q "$END_UUID" /tmp/console.html; do
TRIES=$((TRIES+1))
if [ $TRIES -gt $RETRY_LIMIT ]; then
echo "Failed grabbing consoleLog within $RETRY_LIMIT retries."
break
fi
sleep 3