Use trap by exit on any errors
Change-Id: Id7a379ae634a62278256315ca1f073ae7d8bad5a
diff --git a/de/heat-templates/scripts/instance_boot.sh b/de/heat-templates/scripts/instance_boot.sh
index b8689db..2d5db67 100644
--- a/de/heat-templates/scripts/instance_boot.sh
+++ b/de/heat-templates/scripts/instance_boot.sh
@@ -906,6 +906,14 @@
setup_evpn
}
+# Exit on any errors
+function handle_exit {
+ if [ $? != 0 ] ; then
+ wait_condition_send "FAILURE" "Script is failure."
+ fi
+}
+trap handle_exit EXIT
+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
case "$NODE_TYPE" in
# Please keep the "prepare_metadata_files", "disable-rp-filter", "network_config" and "prepare_network" functions