libvirt: Stop installing python bindings from pip

As set out in bug #1933096 these bindings are dynamically built against
the version of libvirt present in the environment at build time.

As a result using a pre-built wheel can cause AttributeError's when the
bindings have previously been built elsewhere against an older version
of libvirt installed on the host. This is currently the case in CentOS 8
stream based CI jobs where we try to use 7.4.0 bindings that appear to
be built against libvirt <= 6.10 leading to bug #1933096.

This change seeks to avoid this by installing the bindings from packages
that will always be built against the correct corresponding version of
libvirt.

Change-Id: I76184c17a776c4e1ecaab9549d9d36c8c07c60fa
Closes-Bug: #1933096
This commit is contained in:
Lee Yarwood 2021-06-29 09:18:47 +01:00
parent 94d7cacfe2
commit f0bf2bdff1

View File

@ -58,13 +58,10 @@ EOF
function install_libvirt {
if is_ubuntu; then
install_package qemu-system libvirt-clients libvirt-daemon-system libvirt-dev
install_package qemu-system libvirt-clients libvirt-daemon-system libvirt-dev python3-libvirt
if is_arch "aarch64"; then
install_package qemu-efi
fi
# uninstall in case the libvirt version changed
pip_uninstall libvirt-python
pip_install_gr libvirt-python
#pip_install_gr <there-si-no-guestfs-in-pypi>
elif is_fedora || is_suse; then
@ -79,14 +76,11 @@ function install_libvirt {
# as the base system version is too old. We should have
# pre-installed these
install_package qemu-kvm
install_package libvirt libvirt-devel python3-libvirt
install_package libvirt libvirt-devel
if is_arch "aarch64"; then
install_package edk2.git-aarch64
fi
pip_uninstall libvirt-python
pip_install_gr libvirt-python
fi
if [[ $DEBUG_LIBVIRT_COREDUMPS == True ]]; then