From 699d30b1eb05425717abde6a15a8a14d143717d7 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 17 Jan 2017 14:23:59 -0800 Subject: [PATCH] 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. --- tools/provision | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/provision b/tools/provision index 1effcd077b..b65d5f4e1a 100755 --- a/tools/provision +++ b/tools/provision @@ -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]}