From d9f09c66f2ea4fd8ea15ca8a267e94fe988c0310 Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Fri, 8 Jan 2021 11:17:27 +0100 Subject: [PATCH] tools: Fix checking of args number in deploy-qemu When the deploy-qemu script is run with less than 2 arguments, it ended with error, instead of printing usage. This was due to using 'set -u' and trying to expand unset variables "$1" and "$2" as part of checking if they were provided. The issue has been fixed by checking number of provided arguments, instead of their content. The same approach is used in 'deploy-openstack' script. Signed-off-by: Tomas Hozza --- tools/deploy-qemu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/deploy-qemu b/tools/deploy-qemu index 7866337a3..301ce45f6 100755 --- a/tools/deploy-qemu +++ b/tools/deploy-qemu @@ -17,7 +17,7 @@ set -euo pipefail -if [[ -z "$1" || -z "$2" ]]; then +if [[ "$#" != 2 ]]; then echo "usage: $0 IMAGE USERDATA" exit 1 fi