From feeef570072d16b4751bd3efeffd2de58e31994d Mon Sep 17 00:00:00 2001 From: Diod FR Date: Mon, 15 Jul 2024 20:17:53 +0200 Subject: [PATCH] Fix powertools installation for RHEL (#259) * fix powertools installation for RHEL * Fix INSTALLED_FILE typo everywhere and if condition --- slurm/install/rhel.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/slurm/install/rhel.sh b/slurm/install/rhel.sh index b683b8ba..ec7e19be 100755 --- a/slurm/install/rhel.sh +++ b/slurm/install/rhel.sh @@ -3,8 +3,8 @@ # Licensed under the MIT License. # set -e -INSALLED_FILE=/etc/azslurm-bins.installed -if [ -e $INSALLED_FILE ]; then +INSTALLED_FILE=/etc/azslurm-bins.installed +if [ -e $INSTALLED_FILE ]; then exit 0 fi @@ -12,11 +12,16 @@ SLURM_ROLE=$1 SLURM_VERSION=$2 DISABLE_PMC=$3 OS_VERSION=$(cat /etc/os-release | grep VERSION_ID | cut -d= -f2 | cut -d\" -f2 | cut -d. -f1) +OS_ID=$(cat /etc/os-release | grep ^ID= | cut -d= -f2 | cut -d\" -f2 | cut -d. -f1) yum -y install epel-release yum -y install munge jq if [ "$OS_VERSION" -gt "7" ]; then - dnf -y --enablerepo=powertools install -y perl-Switch + if [ "${OS_ID,,}" == "rhel" ]; then + dnf -y install -y perl-Switch + else + dnf -y --enablerepo=powertools install -y perl-Switch + fi PACKAGE_DIR=slurm-pkgs-rhel8 else yum -y install python3 @@ -57,7 +62,7 @@ if [ "$DISABLE_PMC" == "False" ]; then yum -y install $pkg-${SLURM_VERSION}.el${OS_VERSION} --disableexcludes slurm done fi - touch $INSALLED_FILE + touch $INSTALLED_FILE exit fi @@ -79,4 +84,4 @@ if [ ${SLURM_ROLE} == "execute" ]; then done fi -touch $INSALLED_FILE +touch $INSTALLED_FILE