diff options
author | Slawek Kaplonski <skaplons@redhat.com> | 2022-09-14 15:33:43 +0200 |
---|---|---|
committer | Slawek Kaplonski <skaplons@redhat.com> | 2022-09-14 14:32:34 +0000 |
commit | 4eaa526c5a58e497cc11e81c4f473d11dc4d9f0c (patch) | |
tree | 4c82f8d0e5150a8411b59cad3cf9c15e92b47c5d /roles | |
parent | 5114a2643ee1eac5ca1bd7d047013598f04b673f (diff) | |
download | neutron-4eaa526c5a58e497cc11e81c4f473d11dc4d9f0c.tar.gz |
[Functional] Prepare test logs archive only if logs are available
Recent change [1] moved all functional and fullstack tests to be
uploaded in single archive to Swift.
Sometimes, like e.g. in case of the networking-bgpvpn functional
tests, there is no logs directory at all so ansible tasks to prepare
tar.gz archive shouldn't be created at all.
[1] https://review.opendev.org/c/openstack/neutron/+/855868
Change-Id: I50cb1187ef772b6411fe91d6d74aba04a2d3e936
Diffstat (limited to 'roles')
-rw-r--r-- | roles/prepare_functional_tests_logs/tasks/main.yaml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/roles/prepare_functional_tests_logs/tasks/main.yaml b/roles/prepare_functional_tests_logs/tasks/main.yaml index 1f65d87402..608c0c2f83 100644 --- a/roles/prepare_functional_tests_logs/tasks/main.yaml +++ b/roles/prepare_functional_tests_logs/tasks/main.yaml @@ -1,8 +1,14 @@ +- name: Check if {{ logs_path }} exists + stat: + path: "{{ logs_path }}" + register: logs_path_info + - name: Prepare logs archive {{ log_archive_file_name }} become: yes shell: cmd: | /usr/bin/tar -czf {{ log_archive_file_name }} {{ logs_path }} + when: logs_path_info.stat.exists - name: Set {{ log_archive_file_name }} ownership become: yes @@ -11,3 +17,4 @@ owner: "{{ ansible_user }}" group: "{{ ansible_user }}" mode: 0775 + when: logs_path_info.stat.exists |