diff options
| author | Mark Goddard <mark@stackhpc.com> | 2018-09-24 09:32:02 +0100 |
|---|---|---|
| committer | Mark Goddard <mark@stackhpc.com> | 2018-09-24 09:32:02 +0100 |
| commit | 652b78fc51fa8a7bb9b1a0fe0af40b21bb1fa492 (patch) | |
| tree | 2872710dc1d056f5e0176e4246b98c58d0249a98 /tests/post.yml | |
| parent | 0b6e401c4fdb9aa4ff87d0bfd4b25c91b86e0d60 (diff) | |
| download | kolla-ansible-652b78fc51fa8a7bb9b1a0fe0af40b21bb1fa492.tar.gz kolla-ansible-652b78fc51fa8a7bb9b1a0fe0af40b21bb1fa492.zip | |
Fix POST_FAILURE in CI when ARA DB doesn't exist
If the main CI job fails before generating an ARA report, the SQLite
database file will not exist. This cases the job to fail with
POST_FAILURE, rather than FAILURE, and the following is seen in the
logs:
rsync: change_dir "/home/zuul/.ara" failed: No such file or directory
rsync error: some files/attrs were not transferred (see previous errors)
(code 23) at main.c(1655) [Receiver=3.1.1]
rsync: [Receiver] write error: Broken pipe (32)
This change fixes this by checking for an SQLite database file, and only
intiating the rsync transfer if it exists.
Change-Id: I370e5bc9f137abe552918a3215a025fa61e3a0ca
Diffstat (limited to 'tests/post.yml')
| -rw-r--r-- | tests/post.yml | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/tests/post.yml b/tests/post.yml index 68f8f08ff..d84eeea3e 100644 --- a/tests/post.yml +++ b/tests/post.yml @@ -37,15 +37,22 @@ - hosts: primary tasks: - - name: ensure ara-report folder existence - file: - path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/ara-report" - state: directory - delegate_to: localhost - run_once: true - - - name: download ara sqlite - synchronize: - src: "{{ ansible_env.HOME }}/.ara/ansible.sqlite" - dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/ara-report/" - mode: pull + - name: check for existence of ara sqlite + stat: + path: "{{ ansible_env.HOME }}/.ara/ansible.sqlite" + register: ara_stat_result + + - block: + - name: ensure ara-report folder existence + file: + path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/ara-report" + state: directory + delegate_to: localhost + run_once: true + + - name: download ara sqlite + synchronize: + src: "{{ ansible_env.HOME }}/.ara/ansible.sqlite" + dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/ara-report/" + mode: pull + when: ara_stat_result.stat.exists |
