From 465f5749b43bbff080b99947edc6a3c12be5cf50 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 11 Sep 2019 21:35:19 +0100 Subject: [PATCH] Allow venv python interpreter to be overridden Also allow a default var to be specified per distro, maintaining the current functionality for tripleo without requiring an override. Change-Id: I99e0082a748d62ed129a860c6f16c523dec8d50e --- defaults/main.yml | 1 + tasks/tempest_install_source.yml | 1 + vars/redhat-8.yml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index acbcd29a..6834578a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -23,6 +23,7 @@ stestr_executable: "{{ _stestr_executable | default('stestr') }}" # on choosing source it will install from git or venv # on choosing distro it will install based on distribution tempest_install_method: "source" +tempest_venv_python_executable: "{{ openstack_venv_python_executable | default(_tempest_venv_python_executable) | default('python2') }}" # Set the package install state for distribution and pip packages # # Options are 'present' and 'latest' diff --git a/tasks/tempest_install_source.yml b/tasks/tempest_install_source.yml index 212ac56e..98f76dbc 100644 --- a/tasks/tempest_install_source.yml +++ b/tasks/tempest_install_source.yml @@ -20,6 +20,7 @@ import_role: name: "python_venv_build" vars: + venv_python_executable: "{{ tempest_venv_python_executable }}" venv_build_constraints: "{{ tempest_git_constraints }}" venv_install_destination_path: "{{ tempest_venv_bin | dirname }}" venv_pip_install_args: "{{ tempest_pip_install_args }}" diff --git a/vars/redhat-8.yml b/vars/redhat-8.yml index 7b046805..811d2bb9 100644 --- a/vars/redhat-8.yml +++ b/vars/redhat-8.yml @@ -25,7 +25,7 @@ _stestr_executable: stestr-3 # virtualenv. By default venv_python_executable var sets to python2, changing it # in the role itself, breaks other roles. So for distros using python3 making the # change here fixes the issue. -venv_python_executable: "python3" +_tempest_venv_python_executable: "python3" tempest_service_distro_packages: - openstack-tempest