From 86544f7980c95916fd828bc8bdf4df903d4c720d Mon Sep 17 00:00:00 2001 From: "Michael S. Pedersen" Date: Thu, 15 Oct 2020 10:31:04 +0000 Subject: [PATCH] Update check of libvirt(d) group Current check assumes whitespaces on either side of group name. This patch removes that assumption Signed-off-by: Michael S. Pedersen Change-Id: I4802420530be05831b8611b812c9866055cac714 Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/71257 Tested-by: jenkins-ci Reviewed-by: Victor Morales Reviewed-by: Georg Kunz --- functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index f0e1213..26db3c6 100755 --- a/functions.sh +++ b/functions.sh @@ -74,7 +74,7 @@ check_prerequisites() { if [ "${ID,,}" == "ubuntu" ] && [ "$VERSION_ID" == "16.04" ]; then libvirt_group+="d" fi - if ! groups | grep " $libvirt_group "; then + if ! groups | grep "$libvirt_group"; then echo "ERROR : $(id -nu) user doesn't belong to $libvirt_group group." exit 1 fi -- 2.16.6