From 8376f856b69de9fb15613932d1683a4884d64bdb Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Mon, 29 Apr 2024 09:42:32 +0100 Subject: [PATCH] libvirt: Fix config_libvirt to not exit config_libvirt.sh has `set -o errexit`, so we can't use a grep for rhel and test if it fails as this will exit the script. Instead use the ID field from `/etc/os-release` or `/usr/lib/os-release` Signed-off-by: stevenhorsman --- src/cloud-api-adaptor/libvirt/config_libvirt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloud-api-adaptor/libvirt/config_libvirt.sh b/src/cloud-api-adaptor/libvirt/config_libvirt.sh index 00fdd66f0..7c25f5c55 100755 --- a/src/cloud-api-adaptor/libvirt/config_libvirt.sh +++ b/src/cloud-api-adaptor/libvirt/config_libvirt.sh @@ -9,11 +9,11 @@ set -o errexit set -o nounset set -o pipefail +source /etc/os-release || source /usr/lib/os-release ARCH=$(uname -m) TARGET_ARCH=${ARCH/x86_64/amd64} OS_DISTRO=ubuntu -cat /etc/os-release | grep "^ID=" | grep rhel -if [ $? == 0 ]; then +if [[ "$ID" == "rhel" ]]; then OS_DISTRO=rhel fi