Check for virtualenv binary

The current check looks for a virtualenv package; but this isn't
portable to other platforms.  In the gate we also have installed from
upstream (to ensure latest) and the package might be on hold, etc
which might mess up the detection.

I think the KISS thing to do is to check for virtualenv and fail with
a useful message.

Change-Id: Icf15ddd18ca52885f5c4a89a7d83622a70c811d5
This commit is contained in:
Ian Wienand 2018-02-06 08:09:22 +11:00
parent dcbf25e2c9
commit 89bfc2a9fb
1 changed files with 11 additions and 5 deletions

View File

@ -3,12 +3,18 @@
src: "{{ test_matrix_features }}" src: "{{ test_matrix_features }}"
dest: "{{ ansible_user_dir }}" dest: "{{ ansible_user_dir }}"
- name: Check for virtualenv
command: which virtualenv
changed_when: false
failed_when: false
register: virtualenv_available
- name: Ensure virtualenv is installed - name: Ensure virtualenv is installed
become: true fail:
package: msg: "Please ensure virtualenv is available!"
name: virtualenv when:
state: present - virtualenv_available | failed
when: ansible_os_family != 'Darwin' - ansible_os_family != 'Darwin'
- name: Install PyYAML to parse the test matrix - name: Install PyYAML to parse the test matrix
pip: pip: