From 09bd7c8fd5a662ef697eb61638efbe862a4875a6 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 3 Feb 2014 08:35:26 +0900 Subject: [PATCH] enable -o errexit devstack should run under -o errexit to ensure that we fail early when something has gone wrong, otherwise determination of the root failure location is often quite challenging. this clears all the normal use cases for devstack, there could be tests which now die early, which we're going to have to check for later. Change-Id: Ibd828c4f4fd95a60d3918d3d7ae90e10649479ab --- functions-common | 3 ++- stack.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/functions-common b/functions-common index 4bc3bbaac5..3e29e8c7de 100644 --- a/functions-common +++ b/functions-common @@ -1094,7 +1094,8 @@ function service_check() { fi # Check if there is any falure flag file under $SERVICE_DIR/$SCREEN_NAME - failures=`ls "$SERVICE_DIR/$SCREEN_NAME"/*.failure 2>/dev/null` + # make this -o errexit safe + failures=`ls "$SERVICE_DIR/$SCREEN_NAME"/*.failure 2>/dev/null || /bin/true` for service in $failures; do service=`basename $service` diff --git a/stack.sh b/stack.sh index c95199769f..d43a73a889 100755 --- a/stack.sh +++ b/stack.sh @@ -601,6 +601,9 @@ function err_trap { exit $r } + +set -o errexit + # Print the commands being run so that we can see the command that triggers # an error. It is also useful for following along as the install occurs. set -o xtrace