Fix command not found in scripts lib

The successorator originally incremented RETRY with ((RETRY++)).
Bashate decided that was an ambiguous redirect  (why?, I don't care
about the output, I just want the variable to incremented). As a result
we changed the increment statement to $((RETRY++)), this increments the
variable, then tries to execute it, so the log contains:

"scripts/scripts-library.sh: line 51: 1: command not found"

I was going to add _=$((RETRY++)) but its getting ugly, so I replaced
the while loop with a c-style for loop that allows the increment
operator in the third statement.

Change-Id: I3db03dcefbcbe2b4c51e414f9fd2fee73e16a62e
This commit is contained in:
Hugh Saunders 2016-03-09 18:45:20 +00:00 committed by Jesse Pretorius (odyssey4me)
parent 18c7efbda1
commit 02c555ae0b

View File

@ -44,11 +44,9 @@ function successerator {
set +e
# Get the time that the method was started.
OP_START_TIME=$(date +%s)
RETRY=0
# Set the initial return value to failure.
false
while [ $? -ne 0 -a ${RETRY} -lt ${MAX_RETRIES} ];do
$((RETRY++))
for ((RETRY=0; $? != 0 && RETRY < MAX_RETRIES; RETRY++)); do
if [ ${RETRY} -gt 1 ];then
$@ -vvvv
else