Skip to content

Commit

Permalink
libvirt: Fix config_libvirt to not exit
Browse files Browse the repository at this point in the history
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 <steven@uk.ibm.com>
  • Loading branch information
stevenhorsman authored and wainersm committed Apr 29, 2024
1 parent a589f66 commit a0e0f80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cloud-api-adaptor/libvirt/config_libvirt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a0e0f80

Please sign in to comment.