From b365a67c7ef7181b10418d6d43b9183cdf4e291e Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 12 Mar 2020 11:03:14 +1100 Subject: [PATCH] Convert testmatrix run to venv As part of our efforts to ship bare nodes, we want to install as little as possible in any sort of pre-run jobs. Since all infra nodes have python3 available, use venv to create this small environment for the test matrix production, and avoid having to pull in any other dependencies. Change-Id: Ie8b09ab60841f9d1b15ae1a7afec51906cd89f95 --- roles/test-matrix/tasks/main.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/roles/test-matrix/tasks/main.yaml b/roles/test-matrix/tasks/main.yaml index d6927021..f3edba48 100644 --- a/roles/test-matrix/tasks/main.yaml +++ b/roles/test-matrix/tasks/main.yaml @@ -3,23 +3,23 @@ src: "{{ test_matrix_features }}" dest: "{{ ansible_user_dir }}" -- name: Check for virtualenv - command: which virtualenv +- name: Check for venv + command: python3 -m venv -h changed_when: false failed_when: false - register: virtualenv_available + register: venv_available -- name: Ensure virtualenv is installed +- name: Ensure venv fail: - msg: "Please ensure virtualenv is available!" + msg: Can not find venv module? when: - - virtualenv_available.rc != 0 - - ansible_os_family != 'Darwin' + - venv_available.rc != 0 -- name: Install PyYAML to parse the test matrix - pip: - name: PyYAML - virtualenv: "/tmp/.test_matrix_venv" +- name: Create testmatrix venv + command: python3 -m venv /tmp/.test_matrix_venv + +- name: Install PyYAML to venv + command: /tmp/.test_matrix_venv/bin/pip install PyYAML - name: Append neutron to configs for stable/ocata+ set_fact: