Return actual exit code from retry

This commit is contained in:
William Wernert
2021-05-10 13:22:13 -04:00
parent fec868432f
commit f793450d97

View File

@@ -302,6 +302,7 @@ retry() {
cmd=$3 cmd=$3
expectedOutput=$4 expectedOutput=$4
attempt=0 attempt=0
local exitcode=0
while [[ $attempt -lt $maxAttempts ]]; do while [[ $attempt -lt $maxAttempts ]]; do
attempt=$((attempt+1)) attempt=$((attempt+1))
echo "Executing command with retry support: $cmd" echo "Executing command with retry support: $cmd"
@@ -321,7 +322,7 @@ retry() {
sleep $sleepDelay sleep $sleepDelay
done done
echo "Command continues to fail; giving up." echo "Command continues to fail; giving up."
return 1 return $exitcode
} }
run_check_net_err() { run_check_net_err() {