Support installing with Python 3 on CentOS 7
RHEL/CentOS 8 dropped support for some older hardware that is still in use. Since CentOS 7 has Python 3, let's support it for now. Also fixes an issue with C.UTF-8 locale which does not seem to work on CentOS 7 (and actually causes a failure with newer python packages). Change-Id: I1b5797b030ef896ad4b2a95a504a0215ca6ee574
This commit is contained in:
parent
040e5f2ce0
commit
a28b8fa5bc
11
.zuul.yaml
11
.zuul.yaml
@ -79,6 +79,15 @@
|
|||||||
image_type: 'dib'
|
image_type: 'dib'
|
||||||
image_distro: 'centos7'
|
image_distro: 'centos7'
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: ironic-python-agent-check-image-dib-centos7-python3
|
||||||
|
parent: ironic-python-agent-check-image-base
|
||||||
|
required-projects:
|
||||||
|
- openstack/diskimage-builder
|
||||||
|
vars:
|
||||||
|
image_type: 'dib'
|
||||||
|
image_distro: 'centos7'
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: ironic-python-agent-check-image-dib-centos8
|
name: ironic-python-agent-check-image-dib-centos8
|
||||||
parent: ironic-python-agent-check-image-base
|
parent: ironic-python-agent-check-image-base
|
||||||
@ -133,6 +142,8 @@
|
|||||||
- ironic-python-agent-check-image-dib-centos8
|
- ironic-python-agent-check-image-dib-centos8
|
||||||
- ironic-python-agent-check-image-dib-centos7
|
- ironic-python-agent-check-image-dib-centos7
|
||||||
# Non-voting jobs
|
# Non-voting jobs
|
||||||
|
- ironic-python-agent-check-image-dib-centos7-python3:
|
||||||
|
voting: false
|
||||||
- ironic-python-agent-check-image-dib-fedora:
|
- ironic-python-agent-check-image-dib-fedora:
|
||||||
voting: false
|
voting: false
|
||||||
- ironic-python-agent-check-image-dib-debian:
|
- ironic-python-agent-check-image-dib-debian:
|
||||||
|
@ -13,11 +13,28 @@ IPADIR=/tmp/ironic-python-agent
|
|||||||
UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
|
UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
|
||||||
VENVDIR=/opt/ironic-python-agent
|
VENVDIR=/opt/ironic-python-agent
|
||||||
|
|
||||||
|
IPA_PYTHON_VERSION=$DIB_PYTHON_VERSION
|
||||||
|
IPA_PYTHON="$DIB_PYTHON"
|
||||||
|
|
||||||
|
case "$DISTRO_NAME" in
|
||||||
|
centos7|rhel7)
|
||||||
|
# NOTE(dtantsur): C.UTF-8 doesn't seem to exist in CentOS 7
|
||||||
|
export LC_ALL=en_US.UTF-8
|
||||||
|
|
||||||
|
if grep -q 'Python :: 3 :: Only' $IPADIR/setup.cfg; then
|
||||||
|
echo "WARNING: using Python 3 on CentOS 7, this is not recommended"
|
||||||
|
${YUM:-yum} install -y python3 python3-devel
|
||||||
|
IPA_PYTHON=python3
|
||||||
|
IPA_PYTHON_VERSION=3
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# create the virtual environment using the default python
|
# create the virtual environment using the default python
|
||||||
if [ $DIB_PYTHON_VERSION == 3 ]; then
|
if [ $IPA_PYTHON_VERSION == 3 ]; then
|
||||||
$DIB_PYTHON -m venv $VENVDIR
|
$IPA_PYTHON -m venv $VENVDIR
|
||||||
else
|
else
|
||||||
$DIB_PYTHON -m virtualenv $VENVDIR
|
$IPA_PYTHON -m virtualenv $VENVDIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pip might be an older version which does not support the -c option, therefore
|
# pip might be an older version which does not support the -c option, therefore
|
||||||
|
5
releasenotes/notes/centos7-python3-185f1d35c37096c7.yaml
Normal file
5
releasenotes/notes/centos7-python3-185f1d35c37096c7.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Supports building images for Ussuri+ on CentOS 7 using Python 3. This is
|
||||||
|
not recommended but is necessary for some older hardware.
|
Loading…
Reference in New Issue
Block a user