summaryrefslogtreecommitdiffstats
path: root/network/scripts
diff options
context:
space:
mode:
authorSteve Baker <sbaker@redhat.com>2017-01-17 11:02:54 +1100
committerSteve Baker <sbaker@redhat.com>2017-01-18 11:06:29 +1100
commit22ffadd3258c258069b9f4b9df140a6d4b1a5f8d (patch)
treedc8572609476072f877afdc63674088bf40d03b2 /network/scripts
parent97488b8ba38b6abf38b146ea5575a3c7797a87cb (diff)
set -e in run-os-net-config.sh
This runs run-os-net-config.sh with set -e except for ping and os-net-config --detailed-exit-codes which are expected to return non-zero values. Change-Id: Iffe00a97612ccb1c79ed037ce93f6c2e685164d9
Diffstat (limited to 'network/scripts')
-rwxr-xr-xnetwork/scripts/run-os-net-config.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/network/scripts/run-os-net-config.sh b/network/scripts/run-os-net-config.sh
index a7dbedc7..8fe2d270 100755
--- a/network/scripts/run-os-net-config.sh
+++ b/network/scripts/run-os-net-config.sh
@@ -10,7 +10,7 @@
# a deployment input via input_values
# $network_config : the json serialized os-net-config config to apply
#
-set -ux
+set -eux
function get_metadata_ip() {
@@ -98,8 +98,10 @@ EOF_CAT
fi
fi
done
+ set +e
os-net-config -c /etc/os-net-config/dhcp_all_interfaces.yaml -v --detailed-exit-codes --cleanup
RETVAL=$?
+ set -e
if [[ $RETVAL == 2 ]]; then
ping_metadata_ip
elif [[ $RETVAL != 0 ]]; then
@@ -123,8 +125,10 @@ if [ -n '$network_config' ]; then
sed -i "s/bridge_name/${bridge_name:-''}/" /etc/os-net-config/config.json
sed -i "s/interface_name/${interface_name:-''}/" /etc/os-net-config/config.json
+ set +e
os-net-config -c /etc/os-net-config/config.json -v --detailed-exit-codes
RETVAL=$?
+ set -e
if [[ $RETVAL == 2 ]]; then
ping_metadata_ip