Browse Source

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
changes/10/541010/1
Ian Wienand 3 years ago
parent
commit
89bfc2a9fb
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      roles/test-matrix/tasks/main.yaml

+ 11
- 5
roles/test-matrix/tasks/main.yaml View File

@ -3,12 +3,18 @@
src: "{{ test_matrix_features }}"
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
become: true
package:
name: virtualenv
state: present
when: ansible_os_family != 'Darwin'
fail:
msg: "Please ensure virtualenv is available!"
when:
- virtualenv_available | failed
- ansible_os_family != 'Darwin'
- name: Install PyYAML to parse the test matrix
pip:


Loading…
Cancel
Save