ensure-tox: Avoid Reinstalling tox venv if present
On a static node where tox isn't present in the PATH, tox would be always reinstalled even if already present in venv because it's not checked. This patch adds tox_venv check, the first matching line is used to get executable path Change-Id: Ia27af308cd3b5e2ce5efe36508fe82468e88cbc7
This commit is contained in:
parent
bf43f5bb8c
commit
0b152244e4
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
- name: Check if tox is installed
|
- name: Check if tox is installed
|
||||||
shell: |
|
shell: |
|
||||||
command -v {{ tox_executable }} || exit 1
|
command -v {{ tox_executable }} {{ tox_venv_path }}/bin/tox || exit 1
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
register: tox_preinstalled
|
register: tox_preinstalled
|
||||||
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
- name: Export preinstalled tox_exectuable
|
- name: Export preinstalled tox_exectuable
|
||||||
set_fact:
|
set_fact:
|
||||||
tox_executable: '{{ tox_preinstalled.stdout }}'
|
tox_executable: '{{ tox_preinstalled.stdout_lines[0] }}'
|
||||||
cacheable: true
|
cacheable: true
|
||||||
when: tox_preinstalled.rc == 0
|
when: tox_preinstalled.rc == 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user