Skip to content

Commit

Permalink
Properly check for an existing log directory
Browse files Browse the repository at this point in the history
If a log directory already exists, and is a link, these
tasks fail. This patch modifies the process to ensure
that the task works regardless of whether the existing
directory is a directory or a link, and creates the
missing directory if necessary.

Change-Id: I519d7196806f9b97186429b02474274708a8d441
  • Loading branch information
Jesse Pretorius committed Feb 8, 2018
1 parent 53c26dc commit 4b9f101
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tasks/tempest_post_install.yml
Expand Up @@ -34,7 +34,7 @@
- name: Stat for tempest log dir
stat:
path: "{{ tempest_log_dir }}"
register: tempest_log_dir_exists
register: _tempest_log_dir_check

- name: Create tempest directories
file:
Expand All @@ -44,11 +44,9 @@
group: "root"
mode: "{{ item.mode|default('0755') }}"
with_items:
- path: "{{ tempest_log_dir }}"
when: "not tempest_log_dir_exists.stat.exists"
- path: "{{ (_tempest_log_dir_check.stat.exists and _tempest_log_dir_check.stat.islnk) | ternary(_tempest_log_dir_check.stat.lnk_source, tempest_log_dir) }}"
- path: "{{ ansible_env.HOME }}/.tempest/etc"
- path: "{{ tempest_image_dir }}"
when: item.when | default(True)

- name: Copy tempest config
config_template:
Expand Down

0 comments on commit 4b9f101

Please sign in to comment.