Restore function "with_default_retries"
1) Previous commit removed a shell function by mistake, that is being referenced by "clone-source". Restore this function. 2) Make sure "with_retries" works correctly when "set -e" is in effect Story: 2010226 Task: 48064 TESTS ========================== Run "clone-source" and make sure it works Signed-off-by: Davlet Panech <davlet.panech@windriver.com> Change-Id: I1bbf4bf041305860d2c8db83f5130f424084255c
This commit is contained in:
parent
65b3abbae9
commit
2ae368cc7f
@ -66,13 +66,13 @@ function with_retries {
|
|||||||
local rc=0
|
local rc=0
|
||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
let attempt++
|
let ++attempt
|
||||||
|
|
||||||
echo "Running: ${cmd} $@" >&2
|
echo "Running: ${cmd} $@" >&2
|
||||||
${to_cmd} ${cmd} "$@"
|
if ${to_cmd} ${cmd} "$@" ; then
|
||||||
rc=$?
|
|
||||||
if [ $rc -eq 0 ]; then
|
|
||||||
return 0
|
return 0
|
||||||
|
else
|
||||||
|
rc=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $rc -eq 124 ]; then
|
if [ $rc -eq 124 ]; then
|
||||||
@ -92,5 +92,13 @@ function with_retries {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# unreachable
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function with_default_retries {
|
||||||
|
local cmd=$1
|
||||||
|
shift 1
|
||||||
|
with_retries -d "${RETRY_INTERVAL_SEC:-1}" "${RETRIES:-1}" "${cmd}" "$@"
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user