summaryrefslogtreecommitdiffstats
path: root/mcp/scripts/lib.sh
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-10-18 16:20:15 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-10-18 16:20:15 +0000
commitabf3446f4eade931f3b98b0894028c242440ccbd (patch)
treea6cdd5e870a844e35d11ee58616ad38ebd9a9b32 /mcp/scripts/lib.sh
parent2190992952ccc7987f4fbcaf856340ce1ca69c1f (diff)
parent644dc6a6cd8c4a309352a2b2602d757f4acbf63b (diff)
Merge "states: Break on error, retry states up to 5 times" into stable/euphrates
Diffstat (limited to 'mcp/scripts/lib.sh')
-rw-r--r--mcp/scripts/lib.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index 7449a2172..da129a7da 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -e
##############################################################################
# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
# All rights reserved. This program and the accompanying materials
@@ -198,7 +198,8 @@ function wait_for {
# shellcheck disable=SC2034
for attempt in $(seq "${total_attempts}"); do
# shellcheck disable=SC2015
- eval "${cmdstr}" && break || true
+ eval "${cmdstr}" && return 0 || true
echo -n '.'; sleep "${sleep_time}"
done
+ return 1
}