Merge "Move failure trap after functions it uses"

This commit is contained in:
Jenkins 2015-07-07 20:55:15 +00:00 committed by Gerrit Code Review
commit 6b6dd5bfff

View File

@ -19,18 +19,6 @@ echo "*********************************************************************"
set -o errtrace set -o errtrace
trap failed ERR
function failed {
local r=$?
set +o errtrace
set +o xtrace
echo "Failed to execute"
echo "Starting cleanup..."
delete_all
echo "Finished cleanup"
exit $r
}
# Print the commands being run so that we can see the command that triggers # Print the commands being run so that we can see the command that triggers
# an error. It is also useful for following allowing as the install occurs. # an error. It is also useful for following allowing as the install occurs.
set -o xtrace set -o xtrace
@ -441,6 +429,18 @@ function main {
fi fi
} }
trap failed ERR
function failed {
local r=$?
set +o errtrace
set +o xtrace
echo "Failed to execute"
echo "Starting cleanup..."
delete_all
echo "Finished cleanup"
exit $r
}
# Kick off script # Kick off script
# --------------- # ---------------