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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux