Monty Taylor 33fc835f36
Ignore missing tox log directories
ironic-inspector redefines tox envdir, so the code to find the log files
from the environment fails. Add in an ignore to rsync so that files
being missing is not fatal.

Change-Id: Ie93af3569c13c57714e15bb6a9e852e44742662d
2017-10-16 10:18:31 -05:00

43 lines
1.1 KiB
YAML

- name: Set tox log path for multiple nodes
set_fact:
log_path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/tox"
when: groups['all'] | length > 1
- name: Set tox log path for single node
set_fact:
log_path: "{{ zuul.executor.log_root }}/tox"
when: log_path is not defined
- name: Ensure local tox dir
file:
path: "{{ log_path }}"
state: directory
delegate_to: localhost
- name: Set envlist fact
set_fact:
envlist: "{{ tox_envlist.split(',') }}"
when: tox_envlist is defined
- name: Find all environments
command: tox -l
args:
chdir: "{{ zuul_work_dir }}"
register: tox_environments
when: tox_envlist is not defined or tox_envlist == 'all'
- name: Set envlist fact
set_fact:
envlist: "{{ tox_environments.stdout_lines }}"
when: tox_envlist is not defined or tox_envlist == 'all'
- name: Collect tox logs
synchronize:
dest: "{{ log_path }}"
mode: pull
src: "{{ zuul_work_dir }}/.tox/{{ item }}/log/"
verify_host: true
rsync_opts:
- "--ignore-missing-args"
with_items: "{{ envlist }}"