Update check of libvirt(d) group 57/71257/2
authorMichael S. Pedersen <michaelx.pedersen@intel.com>
Thu, 15 Oct 2020 10:31:04 +0000 (10:31 +0000)
committerGeorg Kunz <georg.kunz@ericsson.com>
Wed, 21 Oct 2020 15:06:29 +0000 (15:06 +0000)
Current check assumes whitespaces on either side of group name.
This patch removes that assumption

Signed-off-by: Michael S. Pedersen <michaelx.pedersen@intel.com>
Change-Id: I4802420530be05831b8611b812c9866055cac714
Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/71257
Tested-by: jenkins-ci <jenkins-opnfv-ci@opnfv.org>
Reviewed-by: Victor Morales <chipahuac@hotmail.com>
Reviewed-by: Georg Kunz <georg.kunz@ericsson.com>
functions.sh

index f0e1213..26db3c6 100755 (executable)
@@ -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