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 <thozza@redhat.com>
This commit is contained in:
parent
da6f5ba701
commit
d9f09c66f2
1 changed files with 1 additions and 1 deletions
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
set -euo pipefail
|
||||
|
||||
if [[ -z "$1" || -z "$2" ]]; then
|
||||
if [[ "$#" != 2 ]]; then
|
||||
echo "usage: $0 IMAGE USERDATA"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue