[libvirt] [jenkins-ci PATCH] lcitool: Decouple Python interpreters for Ansible and builds

We need to keep using Python 2 for Ansible, because Python 3 is only supported by the dnf module and on CentOS 7 we have to use the yum module instead; at the same time, all libvirt projects have now dropped Python 2 support so we need to make sure we use Python 3 for building them. Decouple the Python versions used for the two purposes so that we can keep everything working. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/playbooks/update/tasks/paths.yml | 2 ++ guests/playbooks/update/templates/bashrc.j2 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/guests/playbooks/update/tasks/paths.yml b/guests/playbooks/update/tasks/paths.yml index aada1f3..c204462 100644 --- a/guests/playbooks/update/tasks/paths.yml +++ b/guests/playbooks/update/tasks/paths.yml @@ -14,6 +14,7 @@ - make - ninja - ninja-build + - python3 - su - name: 'Look for files' @@ -39,6 +40,7 @@ bash: '{{ commands["bash"] }}' ccache: '{{ commands["ccache"] }}' java: '{{ commands["java"] }}' + python: '{{ commands["python3"] }}' su: '{{ commands["su"] }}' sudoers: '{{ files["sudoers"] }}' diff --git a/guests/playbooks/update/templates/bashrc.j2 b/guests/playbooks/update/templates/bashrc.j2 index d3fc652..9cea90c 100644 --- a/guests/playbooks/update/templates/bashrc.j2 +++ b/guests/playbooks/update/templates/bashrc.j2 @@ -2,7 +2,7 @@ export PS1="[\u@\h \w]\$ " export MAKE="{{ make }}" export NINJA="{{ ninja }}" -export PYTHON="{{ ansible_python_interpreter }}" +export PYTHON="{{ python }}" export MAKEFLAGS="-j{{ install_vcpus|int + 1 }}" -- 2.23.0

On Wed, Dec 04, 2019 at 03:23:25PM +0100, Andrea Bolognani wrote:
We need to keep using Python 2 for Ansible, because Python 3 is only supported by the dnf module and on CentOS 7 we have to use the yum module instead; at the same time, all libvirt projects have now dropped Python 2 support so we need to make sure we use Python 3 for building them.
Decouple the Python versions used for the two purposes so that we can keep everything working.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/playbooks/update/tasks/paths.yml | 2 ++ guests/playbooks/update/templates/bashrc.j2 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Andrea Bolognani
-
Daniel P. Berrangé