[libvirt] [jenkins-ci PATCH] Drop support for python 2
Andrea Bolognani
abologna at redhat.com
Wed Dec 4 14:30:45 UTC 2019
On Wed, 2019-12-04 at 13:26 +0000, Daniel P. Berrangé wrote:
[...]
> +++ b/guests/host_vars/libvirt-centos-7/main.yml
> @@ -16,5 +16,3 @@ package_format: 'rpm'
> package_manager: 'yum'
> os_name: 'CentOS'
> os_version: '7'
> -
> -ansible_python_interpreter: /usr/bin/python2
This will not work: you need to explicitly point Ansible to a Python
3 interpreter, or it will still prefer Python 2 if available, which
it still is on CentOS 7.
Actually, it's more complicated than that: if you point Ansible to a
Python 3 interpreter, you will soon get
TASK [Enable EPEL repository] *************************************
fatal: [libvirt-centos-7]: FAILED! => {"changed": false, "msg":
"The Python 2 bindings for rpm are needed for this module. If you
require Python 3 support use the `dnf` Ansible module instead.. The
Python 2 yum module is needed for this module. If you require
Python 3 support use the `dnf` Ansible module instead."}
I have posted
https://www.redhat.com/archives/libvir-list/2019-December/msg00239.html
which addresses the issue. Please drop this hunk.
[...]
> +++ b/guests/playbooks/update/tasks/bootstrap.yml
> @@ -7,11 +7,5 @@
> - set_fact:
> python: python3
>
> -- set_fact:
> - python: python2
> - when:
> - - os_name == 'CentOS'
> - - os_version == '7'
We don't want this, because as mentioned above we still need Python 2
for Ansible. Please drop this hunk.
[...]
> +++ b/guests/vars/projects/libvirt-python.yml
> @@ -1,9 +1,5 @@
> ---
> packages:
> - - python2
> - - python2-devel
> - - python2-lxml
> - - python2-nose
> - python3-devel
> - python3-lxml
> - python3-nose
These other changes are fine, so
Reviewed-by: Andrea Bolognani <abologna at redhat.com>
if you drop the first two hunks and push after the patch of mine
I mentioned above.
Note that the libvirt-python-rpm job will still fail with
$ rpmbuild --clean --define "_topdir `pwd`/rpmbuild" -ta dist/*.tar.gz
error: Failed build dependencies:
python3-nose is needed by libvirt-python-5.10.0-1.el7.x86_64
That's because on CentOS 7 we have python36-nose (from EPEL) instead
of python3-nose, and python36-lxml instead of python3-lxml. These
issues need to be fixed in libvirt-python, though.
--
Andrea Bolognani / Red Hat / Virtualization
More information about the libvir-list
mailing list