From 7fb32dd599c0d8b5d231cd30c5a8a1ef5142110a Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 7 Sep 2016 16:33:44 +0100 Subject: [PATCH] Fix unbound variable error in scripts/collect-test-info.sh The scripts/collect-test-info.sh script is executed with '-u' which means that unset variables will trigger an error like the following one: scripts/collect-test-info.sh: line 16: TEST_VM_NODE_NAMES: unbound variable We handle this case by simply setting an alternative value when the variable is set in order to treat the unset variable gracefully. Change-Id: Ic4b450fe8654568e30eacb00aeff128d675ed616 --- scripts/collect-test-info.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/collect-test-info.sh b/scripts/collect-test-info.sh index 8b62421fd..3039b1d96 100755 --- a/scripts/collect-test-info.sh +++ b/scripts/collect-test-info.sh @@ -13,7 +13,7 @@ LOG_LOCATION="${WORKSPACE:-${SCRIPT_HOME}/..}/logs" echo "Making logs directory and collecting logs." [ -d ${LOG_LOCATION} ] || mkdir -p ${LOG_LOCATION} -if [ -z "${TEST_VM_NODE_NAMES}" ]; then +if [ -z "${TEST_VM_NODE_NAMES+x}" ]; then sudo cp /var/log/libvirt/baremetal_logs/testvm[[:digit:]]_console.log ${LOG_LOCATION} sudo chown $USER ${LOG_LOCATION}/testvm[[:digit:]]_console.log sudo chmod o+r ${LOG_LOCATION}/testvm[[:digit:]]_console.log