ensure-pip : fix Xenial exported virtualenv command
This is a fix for Id8347b6b09735659a7ed9bbe7f9d2798fbec9620 which did not specify the full path in ensure_pip_virtualenv_command for Xenial. This slipped by testing because there we check ensure_pip_virtualenv_command runs under a shell:, but not when called as the argument to the pip: module (which exec's it differently and requires the full path). Update testing to do that too. Change-Id: I65ff5ce913917079ab2fc1d88c56d1c0a24ea83e
This commit is contained in:
parent
47bce7db05
commit
f578a38693
@ -84,5 +84,5 @@
|
|||||||
|
|
||||||
- name: Override virtualenv
|
- name: Override virtualenv
|
||||||
set_fact:
|
set_fact:
|
||||||
ensure_pip_virtualenv_command: 'virtualenv -p python3'
|
ensure_pip_virtualenv_command: '/usr/local/bin/virtualenv -p python3'
|
||||||
when: _pip_check.rc == 0
|
when: _pip_check.rc == 0
|
||||||
|
@ -1,24 +1,32 @@
|
|||||||
- hosts: all
|
- hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
|
# ensure-pip
|
||||||
|
|
||||||
- name: Include ensure-pip
|
- name: Include ensure-pip
|
||||||
include_role:
|
include_role:
|
||||||
name: ensure-pip
|
name: ensure-pip
|
||||||
|
|
||||||
- name: Sanity check provided virtualenv command works
|
- name: Create temp directory
|
||||||
shell: |
|
tempfile:
|
||||||
tmp_venv=$(mktemp -d -t venv-XXXXXXXXXX)
|
state: directory
|
||||||
trap "rm -rf $tmp_venv" EXIT
|
suffix: venv-test
|
||||||
{{ ensure_pip_virtualenv_command }} $tmp_venv
|
register: _tmp_venv
|
||||||
$tmp_venv/bin/pip install tox
|
|
||||||
failed_when: false
|
|
||||||
register: _venv_sanity
|
|
||||||
|
|
||||||
- name: Assert pip venv sanity check
|
- name: Sanity check provided virtualenv command installs
|
||||||
fail:
|
pip:
|
||||||
msg: 'The virtualenv_command: "{{ ensure_pip_virtualenv_command }}" does not appear to work!'
|
name: tox
|
||||||
when:
|
virtualenv_command: '{{ ensure_pip_virtualenv_command }}'
|
||||||
- _venv_sanity.rc != 0
|
virtualenv: '{{ _tmp_venv.path }}'
|
||||||
|
|
||||||
|
- name: Sanity check installed command runs without error
|
||||||
|
command: '{{ _tmp_venv.path }}/bin/tox --version'
|
||||||
|
|
||||||
|
- name: Remove tmpdir
|
||||||
|
file:
|
||||||
|
path: '{{ _tmp_venv.path }}'
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
# ensure-virtualenv
|
||||||
- name: Include ensure-virtualenv
|
- name: Include ensure-virtualenv
|
||||||
include_role:
|
include_role:
|
||||||
name: ensure-virtualenv
|
name: ensure-virtualenv
|
||||||
|
Loading…
x
Reference in New Issue
Block a user