From 8b8a4c75b72eb44dd5c11950951cf6e6d9a1d778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Wed, 18 Aug 2021 15:00:09 +0000 Subject: [PATCH] Remove libvirt-python from upper-constraints ... when installed from distribution. This is mostly to fix Ironic's gate as their ecosystem is too broad and complex to quickly remove libvirt-python from all possible requirements.txt More details inline. See also: https://review.opendev.org/c/openstack/devstack/+/798514 aka f0bf2bdff12b66eefbb2eae83e919611eb7cc76d Change-Id: Ic44daf15e952bbe3c424984ffb2474261e68008f --- lib/nova_plugins/functions-libvirt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt index e9ceae4dea..63882e05fe 100644 --- a/lib/nova_plugins/functions-libvirt +++ b/lib/nova_plugins/functions-libvirt @@ -56,6 +56,17 @@ EOF # Installs required distro-specific libvirt packages. function install_libvirt { + # NOTE(yoctozepto): The common consensus [1] is that libvirt-python should + # be installed from distro packages. However, various projects might be + # trying to ensure it is installed using pip AND use upper-constraints + # with that, causing pip to try to upgrade it and to fail. + # The following line removes libvirt-python from upper-constraints and + # avoids the situation described above. Now only if installed packages + # explicitly depend on a newer (or, in general, incompatible) libvirt-python + # version, will pip try to reinstall it. + # [1] https://review.opendev.org/c/openstack/devstack/+/798514 + $REQUIREMENTS_DIR/.venv/bin/edit-constraints \ + $REQUIREMENTS_DIR/upper-constraints.txt -- libvirt-python if is_ubuntu; then install_package qemu-system libvirt-clients libvirt-daemon-system libvirt-dev python3-libvirt