summaryrefslogtreecommitdiffstats
path: root/validation-scripts/all-nodes.sh
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-03-03 15:12:13 +0000
committerGerrit Code Review <review@openstack.org>2016-03-03 15:12:13 +0000
commit53715e0bd8100a21f9b36ada4fc2099726ae3cbd (patch)
treec3899576e12214ca3fb96b373722047aba93ea31 /validation-scripts/all-nodes.sh
parentc78ccddb6611a02b5935a3a93bbbf5d54bf154ae (diff)
parentbbb38534866c96e7688618b41449cae07871f3a2 (diff)
Merge "Use set -e for validation-scripts/all-nodes.sh"
Diffstat (limited to 'validation-scripts/all-nodes.sh')
-rw-r--r--validation-scripts/all-nodes.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/validation-scripts/all-nodes.sh b/validation-scripts/all-nodes.sh
index ae1fddf3..31b4d6bf 100644
--- a/validation-scripts/all-nodes.sh
+++ b/validation-scripts/all-nodes.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -e
# For each unique remote IP (specified via Heat) we check to
# see if one of the locally configured networks matches and if so we
@@ -17,11 +18,13 @@ function ping_controller_ips() {
in_network=$(python -c "import ipaddr; net=ipaddr.IPNetwork('$LOCAL_NETWORK'); addr=ipaddr.IPAddress('$REMOTE_IP'); print(addr in net)")
if [[ $in_network == "True" ]]; then
echo -n "Trying to ping $REMOTE_IP for local network $LOCAL_NETWORK..."
+ set +e
if ! $ping -W 300 -c 1 $REMOTE_IP &> /dev/null; then
echo "FAILURE"
echo "$REMOTE_IP is not pingable. Local Network: $LOCAL_NETWORK" >&2
exit 1
fi
+ set -e
echo "SUCCESS"
fi
done
@@ -34,6 +37,7 @@ function ping_controller_ips() {
# multiple gateways.
function ping_default_gateways() {
DEFAULT_GW=$(ip r | grep ^default | cut -d " " -f 3)
+ set +e
for GW in $DEFAULT_GW; do
echo -n "Trying to ping default gateway ${GW}..."
if ! ping -c 1 $GW &> /dev/null; then
@@ -42,6 +46,7 @@ function ping_default_gateways() {
exit 1
fi
done
+ set -e
echo "SUCCESS"
}