Skip to content

Commit 36d654b

Browse files
authored
ASP-4279: Update the dispatch scripts (#183)
1 parent 49938b3 commit 36d654b

File tree

4 files changed

+28
-68
lines changed

4 files changed

+28
-68
lines changed

charm-slurmctld/dispatch

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@ set -e
88
# Source the os-release information into the env
99
. /etc/os-release
1010

11+
# set the default python bin path
12+
PYTHON_BIN="/usr/bin/env python3"
13+
1114
if ! [[ -f '.installed' ]]
1215
then
13-
14-
# Rocky specific setup
15-
if [[ $ID == 'rocky' ]]
16-
then
17-
dnf install epel-release -y
18-
dnf install dnf-plugins-core -y
19-
dnf config-manager --set-enabled powertools -y
20-
fi
21-
22-
if [[ $ID == 'centos' || $ID == 'rocky' ]]
16+
if [[ $ID == 'centos' ]]
2317
then
2418
# Install dependencies
2519
yum -y install epel-release
@@ -37,19 +31,15 @@ then
3731
cd $OLDPWD
3832
rm -rf /tmp/Python*
3933

40-
# set the correct python bin path
34+
# set the custom python bin path
4135
PYTHON_BIN="/opt/python/python3.8/bin/python3.8"
4236
elif [[ $ID == 'ubuntu' ]]
4337
then
4438
# Necessary to compile and install NHC
45-
apt-get install --assume-yes make
46-
47-
# set the correct python bin path
48-
PYTHON_BIN="/usr/bin/env python3"
39+
apt-get install --assume-yes make
4940
fi
5041

5142
touch .installed
5243
fi
5344

54-
55-
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
45+
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py

charm-slurmd/dispatch

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@ set -e
88
# Source the os-release information into the env
99
. /etc/os-release
1010

11+
# set the default python bin path
12+
PYTHON_BIN="/usr/bin/env python3"
13+
1114
if ! [[ -f '.installed' ]]
1215
then
13-
14-
# Rocky specific setup
15-
if [[ $ID == 'rocky' ]]
16-
then
17-
dnf install epel-release -y
18-
dnf install dnf-plugins-core -y
19-
dnf config-manager --set-enabled powertools -y
20-
fi
21-
22-
if [[ $ID == 'centos' || $ID == 'rocky' ]]
16+
if [[ $ID == 'centos' ]]
2317
then
2418
# Install dependencies
2519
yum -y install epel-release
@@ -37,19 +31,15 @@ then
3731
cd $OLDPWD
3832
rm -rf /tmp/Python*
3933

40-
# set the correct python bin path
34+
# set the custom python bin path
4135
PYTHON_BIN="/opt/python/python3.8/bin/python3.8"
4236
elif [[ $ID == 'ubuntu' ]]
4337
then
4438
# Necessary to compile and install NHC
45-
apt-get install --assume-yes make
46-
47-
# set the correct python bin path
48-
PYTHON_BIN="/usr/bin/env python3"
39+
apt-get install --assume-yes make
4940
fi
5041

5142
touch .installed
5243
fi
5344

54-
55-
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
45+
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py

charm-slurmdbd/dispatch

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@ set -e
88
# Source the os-release information into the env
99
. /etc/os-release
1010

11+
# set the default python bin path
12+
PYTHON_BIN="/usr/bin/env python3"
13+
1114
if ! [[ -f '.installed' ]]
1215
then
13-
14-
# Rocky specific setup
15-
if [[ $ID == 'rocky' ]]
16-
then
17-
dnf install epel-release -y
18-
dnf install dnf-plugins-core -y
19-
dnf config-manager --set-enabled powertools -y
20-
fi
21-
22-
if [[ $ID == 'centos' || $ID == 'rocky' ]]
16+
if [[ $ID == 'centos' ]]
2317
then
2418
# Install dependencies
2519
yum -y install epel-release
@@ -37,19 +31,15 @@ then
3731
cd $OLDPWD
3832
rm -rf /tmp/Python*
3933

40-
# set the correct python bin path
34+
# set the custom python bin path
4135
PYTHON_BIN="/opt/python/python3.8/bin/python3.8"
4236
elif [[ $ID == 'ubuntu' ]]
4337
then
4438
# Necessary to compile and install NHC
45-
apt-get install --assume-yes make
46-
47-
# set the correct python bin path
48-
PYTHON_BIN="/usr/bin/env python3"
39+
apt-get install --assume-yes make
4940
fi
5041

5142
touch .installed
5243
fi
5344

54-
55-
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
45+
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py

charm-slurmrestd/dispatch

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@ set -e
88
# Source the os-release information into the env
99
. /etc/os-release
1010

11+
# set the default python bin path
12+
PYTHON_BIN="/usr/bin/env python3"
13+
1114
if ! [[ -f '.installed' ]]
1215
then
13-
14-
# Rocky specific setup
15-
if [[ $ID == 'rocky' ]]
16-
then
17-
dnf install epel-release -y
18-
dnf install dnf-plugins-core -y
19-
dnf config-manager --set-enabled powertools -y
20-
fi
21-
22-
if [[ $ID == 'centos' || $ID == 'rocky' ]]
16+
if [[ $ID == 'centos' ]]
2317
then
2418
# Install dependencies
2519
yum -y install epel-release
@@ -37,19 +31,15 @@ then
3731
cd $OLDPWD
3832
rm -rf /tmp/Python*
3933

40-
# set the correct python bin path
34+
# set the custom python bin path
4135
PYTHON_BIN="/opt/python/python3.8/bin/python3.8"
4236
elif [[ $ID == 'ubuntu' ]]
4337
then
4438
# Necessary to compile and install NHC
45-
apt-get install --assume-yes make
46-
47-
# set the correct python bin path
48-
PYTHON_BIN="/usr/bin/env python3"
39+
apt-get install --assume-yes make
4940
fi
5041

5142
touch .installed
5243
fi
5344

54-
55-
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py
45+
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv $PYTHON_BIN ./src/charm.py

0 commit comments

Comments
 (0)