[libvirt] [jenkins-ci PATCH 5/7] guests: Don't dynamically look for Python binary

Andrea Bolognani abologna at redhat.com
Fri Dec 21 08:36:25 UTC 2018


Now that we need to point Ansible to the Python binary
explicitly and we prefer Python 3 to Python 2 while doing
so, we might as well just re-use the path stored in the
inventory instead of looking for it dynamically.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 guests/playbooks/update/tasks/paths.yml     | 15 ---------------
 guests/playbooks/update/templates/bashrc.j2 |  2 +-
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/guests/playbooks/update/tasks/paths.yml b/guests/playbooks/update/tasks/paths.yml
index 00decc9..08717ba 100644
--- a/guests/playbooks/update/tasks/paths.yml
+++ b/guests/playbooks/update/tasks/paths.yml
@@ -12,8 +12,6 @@
     - gmake
     - java
     - make
-    - python2
-    - python3
     - su
 
 - name: 'Look for files'
@@ -54,16 +52,3 @@
     make: '{{ commands["make"] }}'
   when:
     - make is undefined
-
-# Prefer python3, fall back to python2
-- name: 'Export paths'
-  set_fact:
-    python: '{{ commands["python3"] }}'
-  when:
-    - commands["python3"] != ''
-
-- name: 'Export paths'
-  set_fact:
-    python: '{{ commands["python2"] }}'
-  when:
-    - python is undefined
diff --git a/guests/playbooks/update/templates/bashrc.j2 b/guests/playbooks/update/templates/bashrc.j2
index f0ab23e..1f39cf2 100644
--- a/guests/playbooks/update/templates/bashrc.j2
+++ b/guests/playbooks/update/templates/bashrc.j2
@@ -1,7 +1,7 @@
 export PS1="[\u@\h \w]\$ "
 
 export MAKE="{{ make }}"
-export PYTHON="{{ python }}"
+export PYTHON="{{ ansible_python_interpreter }}"
 
 export MAKEFLAGS="-j{{ install_vcpus|int + 1 }}"
 
-- 
2.19.2




More information about the libvir-list mailing list