provision: Ensure that stderr output isn't buffered badly.

Previously, if a script called by provision threw an error, the
traceback for the called script would be lost far above the traceback
from provision itself in the terminal history, resulting in a great
deal of confusion about what the actual problem was.
This commit is contained in:
Tim Abbott 2017-01-17 14:23:59 -08:00
parent 789ae8648a
commit 699d30b1eb
1 changed files with 3 additions and 0 deletions

View File

@ -15,6 +15,9 @@ PROVISION_PATH="lib/provision.py"
echo "PROVISIONING STARTING." >> $LOG_PATH
# PYTHONUNBUFFERED is important to ensure that tracebacks don't get
# lost far above where they should be in the output.
export PYTHONUNBUFFERED=1
python "$PROVISION_PATH" $@ 2>&1 | tee -a "$LOG_PATH"
failed=${PIPESTATUS[0]}