Skip to content

Commit bcd98e9

Browse files
committed
Fix six package incompatiblity with EL10
1 parent 27bce46 commit bcd98e9

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

packaging/el8/cloud.spec

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Requires: (iptables-services or iptables)
8383
Requires: rng-tools
8484
Requires: (qemu-img or qemu-tools)
8585
Requires: python3-pip
86+
Requires: python3-six
87+
Requires: python3-protobuf
8688
Requires: python3-setuptools
8789
Requires: (libgcrypt > 1.8.3 or libgcrypt20)
8890
Group: System Environment/Libraries
@@ -334,11 +336,11 @@ cp -r ui/dist/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui/
334336
rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui/config.json
335337
ln -sf /etc/%{name}/ui/config.json ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui/config.json
336338

337-
# Package mysql-connector-python
338-
wget -P ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup/wheel https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
339-
wget -P ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup/wheel https://files.pythonhosted.org/packages/e9/93/4860cebd5ad3ff2664ad3c966490ccb46e3b88458b2095145bca11727ca4/setuptools-47.3.1-py3-none-any.whl
340-
wget -P ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup/wheel https://files.pythonhosted.org/packages/32/27/1141a8232723dcb10a595cc0ce4321dcbbd5215300bf4acfc142343205bf/protobuf-3.19.6-py2.py3-none-any.whl
341-
wget -P ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup/wheel https://files.pythonhosted.org/packages/08/1f/42d74bae9dd6dcfec67c9ed0f3fa482b1ae5ac5f117ca82ab589ecb3ca19/mysql_connector_python-8.0.31-py2.py3-none-any.whl
339+
# Package mysql-connector-python (bundled to avoid dependency on external community repo)
340+
# Version 8.0.28 is the last version supporting Python 3.6 (EL8)
341+
wget -P ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup/wheel https://files.pythonhosted.org/packages/04/97/ed816b63425a8a0b313e1374980f6b9bef60c7d685f86a22353e27eb59ec/mysql_connector_python-8.0.28-py2.py3-none-any.whl
342+
# Version 8.3.0 supports Python 3.8 to 3.12 (EL9, EL10)
343+
wget -P ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup/wheel https://files.pythonhosted.org/packages/53/ed/26a4b8cacb8852c6fd97d2d58a7f2591c41989807ea82bd8d9725a4e6937/mysql_connector_python-8.3.0-py2.py3-none-any.whl
342344

343345
chmod 440 ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
344346
chmod 770 ${RPM_BUILD_ROOT}%{_localstatedir}/%{name}/mnt
@@ -455,8 +457,13 @@ then
455457
fi
456458

457459
%post management
458-
# Install mysql-connector-python
459-
pip3 install %{_datadir}/%{name}-management/setup/wheel/six-1.15.0-py2.py3-none-any.whl %{_datadir}/%{name}-management/setup/wheel/setuptools-47.3.1-py3-none-any.whl %{_datadir}/%{name}-management/setup/wheel/protobuf-3.19.6-py2.py3-none-any.whl %{_datadir}/%{name}-management/setup/wheel/mysql_connector_python-8.0.31-py2.py3-none-any.whl
460+
# Install mysql-connector-python wheel
461+
# Detect Python version to install compatible wheel
462+
if python3 -c 'import sys; sys.exit(0 if sys.version_info >= (3, 7) else 1)'; then
463+
pip3 install %{_datadir}/%{name}-management/setup/wheel/mysql_connector_python-8.3.0-py2.py3-none-any.whl
464+
else
465+
pip3 install %{_datadir}/%{name}-management/setup/wheel/mysql_connector_python-8.0.28-py2.py3-none-any.whl
466+
fi
460467

461468
/usr/bin/systemctl enable cloudstack-management > /dev/null 2>&1 || true
462469
/usr/bin/systemctl enable --now rngd > /dev/null 2>&1 || true

0 commit comments

Comments
 (0)