This is conceptually identical to how Perl is handled, except that we still need to override $PYTHONPATH in Jenkins jobs in order to be able to build projects using both Python 3 and Python 2 on the same guest. We might want to reconsider that decision, but for the time being this change is still helpful to people running guests outside of the CI environment. Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx> --- guests/group_vars/all/main.yml | 1 + guests/host_vars/libvirt-centos-6/main.yml | 1 + guests/host_vars/libvirt-centos-7/main.yml | 1 + guests/host_vars/libvirt-debian-8/main.yml | 1 + guests/host_vars/libvirt-debian-9/main.yml | 1 + guests/host_vars/libvirt-debian-sid/main.yml | 1 + guests/host_vars/libvirt-fedora-26/main.yml | 1 + guests/host_vars/libvirt-fedora-27/main.yml | 1 + guests/host_vars/libvirt-fedora-rawhide/main.yml | 1 + guests/host_vars/libvirt-freebsd-10/main.yml | 1 + guests/host_vars/libvirt-freebsd-11/main.yml | 1 + guests/host_vars/libvirt-freebsd-current/main.yml | 1 + guests/host_vars/libvirt-ubuntu-14/main.yml | 1 + guests/host_vars/libvirt-ubuntu-16/main.yml | 1 + guests/templates/bashrc | 2 ++ 15 files changed, 16 insertions(+) diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml index 6456bd5..fb83a56 100644 --- a/guests/group_vars/all/main.yml +++ b/guests/group_vars/all/main.yml @@ -18,6 +18,7 @@ PKG_CONFIG_PATH: $VIRT_PREFIX/lib/pkgconfig XDG_DATA_DIRS: $VIRT_PREFIX/share:/usr/share:/usr/local/share GI_TYPELIB_PATH: $VIRT_PREFIX/lib/girepository-1.0 PERL5LIB: +PYTHONPATH: bash: /bin/bash java: /usr/bin/java diff --git a/guests/host_vars/libvirt-centos-6/main.yml b/guests/host_vars/libvirt-centos-6/main.yml index 2265615..422d033 100644 --- a/guests/host_vars/libvirt-centos-6/main.yml +++ b/guests/host_vars/libvirt-centos-6/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python2.6/site-packages projects: - libvirt diff --git a/guests/host_vars/libvirt-centos-7/main.yml b/guests/host_vars/libvirt-centos-7/main.yml index 3068bb1..935ab15 100644 --- a/guests/host_vars/libvirt-centos-7/main.yml +++ b/guests/host_vars/libvirt-centos-7/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python2.7/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-debian-8/main.yml b/guests/host_vars/libvirt-debian-8/main.yml index 76c0076..bfd074d 100644 --- a/guests/host_vars/libvirt-debian-8/main.yml +++ b/guests/host_vars/libvirt-debian-8/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.20.2 +PYTHONPATH: $VIRT_PREFIX/lib/python3.4/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-debian-9/main.yml b/guests/host_vars/libvirt-debian-9/main.yml index 45bc9de..bdaa00d 100644 --- a/guests/host_vars/libvirt-debian-9/main.yml +++ b/guests/host_vars/libvirt-debian-9/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.24.1 +PYTHONPATH: $VIRT_PREFIX/lib/python3.5/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-debian-sid/main.yml b/guests/host_vars/libvirt-debian-sid/main.yml index 96b49d2..cb61b6e 100644 --- a/guests/host_vars/libvirt-debian-sid/main.yml +++ b/guests/host_vars/libvirt-debian-sid/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.26.1 +PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-fedora-26/main.yml b/guests/host_vars/libvirt-fedora-26/main.yml index b21e829..732df24 100644 --- a/guests/host_vars/libvirt-fedora-26/main.yml +++ b/guests/host_vars/libvirt-fedora-26/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-fedora-27/main.yml b/guests/host_vars/libvirt-fedora-27/main.yml index b21e829..732df24 100644 --- a/guests/host_vars/libvirt-fedora-27/main.yml +++ b/guests/host_vars/libvirt-fedora-27/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml b/guests/host_vars/libvirt-fedora-rawhide/main.yml index b21e829..732df24 100644 --- a/guests/host_vars/libvirt-fedora-rawhide/main.yml +++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib64/perl5 +PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-freebsd-10/main.yml b/guests/host_vars/libvirt-freebsd-10/main.yml index dc1a018..4d57042 100644 --- a/guests/host_vars/libvirt-freebsd-10/main.yml +++ b/guests/host_vars/libvirt-freebsd-10/main.yml @@ -2,6 +2,7 @@ ansible_python_interpreter: /usr/local/bin/python2 PERL5LIB: $VIRT_PREFIX/lib/perl5/site_perl/mach/5.26 +PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages bash: /usr/local/bin/bash java: /usr/local/bin/java diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml b/guests/host_vars/libvirt-freebsd-11/main.yml index dc1a018..4d57042 100644 --- a/guests/host_vars/libvirt-freebsd-11/main.yml +++ b/guests/host_vars/libvirt-freebsd-11/main.yml @@ -2,6 +2,7 @@ ansible_python_interpreter: /usr/local/bin/python2 PERL5LIB: $VIRT_PREFIX/lib/perl5/site_perl/mach/5.26 +PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages bash: /usr/local/bin/bash java: /usr/local/bin/java diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml b/guests/host_vars/libvirt-freebsd-current/main.yml index dc1a018..4d57042 100644 --- a/guests/host_vars/libvirt-freebsd-current/main.yml +++ b/guests/host_vars/libvirt-freebsd-current/main.yml @@ -2,6 +2,7 @@ ansible_python_interpreter: /usr/local/bin/python2 PERL5LIB: $VIRT_PREFIX/lib/perl5/site_perl/mach/5.26 +PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages bash: /usr/local/bin/bash java: /usr/local/bin/java diff --git a/guests/host_vars/libvirt-ubuntu-14/main.yml b/guests/host_vars/libvirt-ubuntu-14/main.yml index a4e8849..b404a5a 100644 --- a/guests/host_vars/libvirt-ubuntu-14/main.yml +++ b/guests/host_vars/libvirt-ubuntu-14/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/perl/5.18.2 +PYTHONPATH: $VIRT_PREFIX/lib/python3.4/site-packages projects: - libosinfo diff --git a/guests/host_vars/libvirt-ubuntu-16/main.yml b/guests/host_vars/libvirt-ubuntu-16/main.yml index 34c5a87..7991608 100644 --- a/guests/host_vars/libvirt-ubuntu-16/main.yml +++ b/guests/host_vars/libvirt-ubuntu-16/main.yml @@ -1,5 +1,6 @@ --- PERL5LIB: $VIRT_PREFIX/lib/x86_64-linux-gnu/perl/5.22.1 +PYTHONPATH: $VIRT_PREFIX/lib/python3.5/site-packages projects: - libosinfo diff --git a/guests/templates/bashrc b/guests/templates/bashrc index a508910..95bb172 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -8,6 +8,8 @@ export PKG_CONFIG_PATH="{{ PKG_CONFIG_PATH }}" export XDG_DATA_DIRS="{{ XDG_DATA_DIRS }}" export GI_TYPELIB_PATH="{{ GI_TYPELIB_PATH }}" export PERL5LIB="{{ PERL5LIB }}" +export PYTHONPATH="{{ PYTHONPATH }}" +which python3 >/dev/null 2>&1 && export PYTHON="python3" || export PYTHON="python2" which gmake >/dev/null 2>&1 && export MAKE="gmake" || export MAKE="make" which ccache >/dev/null 2>&1 && export CC="ccache cc" -- 2.14.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list