Skip to content

Commit 2dcbc28

Browse files
Federico Ressijharbott
authored andcommitted
Install versioned python RPMs on RedHat distros
Set default python3 version as 3 for cases python3 is not installed before running DevStack. Implements installation of required python3x package for RedHat family distros with package name depending on configurable ${PYTHON3_VERSION}. Examples: 3 => python3 python3-devel (default one) 3.6 => python36 python36-devel 3.7 => python37 python37-devel This should help in situations where there are more than one python available for given platform and DevStack is asked to pick one by its full 3.x version Change-Id: I49d86bc9193165e0a41e8e8720be37d81a4e7ee0
1 parent 93d22d8 commit 2dcbc28

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

inc/python

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,11 @@ function install_python3 {
457457
elif is_suse; then
458458
install_package python3-devel python3-dbm
459459
elif is_fedora; then
460-
install_package python3 python3-devel
460+
if [ "$os_VENDOR" = "Fedora" ]; then
461+
install_package python${PYTHON3_VERSION//.}
462+
else
463+
install_package python${PYTHON3_VERSION//.} python${PYTHON3_VERSION//.}-devel
464+
fi
461465
fi
462466
}
463467

stackrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export USE_PYTHON3=$(trueorfalse True USE_PYTHON3)
142142
# version of Python 3 to this variable will install the app using that
143143
# version of the interpreter instead of 2.7.
144144
_DEFAULT_PYTHON3_VERSION="$(_get_python_version python3)"
145-
export PYTHON3_VERSION=${PYTHON3_VERSION:-${_DEFAULT_PYTHON3_VERSION:-3.6}}
145+
export PYTHON3_VERSION=${PYTHON3_VERSION:-${_DEFAULT_PYTHON3_VERSION:-3}}
146146

147147
# Just to be more explicit on the Python 2 version to use.
148148
_DEFAULT_PYTHON2_VERSION="$(_get_python_version python2)"

0 commit comments

Comments
 (0)