diff options
author | J. Javier Maestro <jjmaestro@ieee.org> | 2016-06-10 06:30:06 -0700 |
---|---|---|
committer | Brian Coca <bcoca@ansible.com> | 2016-06-10 09:30:06 -0400 |
commit | 828b73dd2dc277d1ac0c4925a66fa21e66aa175d (patch) | |
tree | 3ad1b3b6116d8bb3f19eb4215b637505ea98e53b /lib/ansible/executor | |
parent | 10860c50bd56459e32b7cdeb80bfc613e917ced9 (diff) | |
download | ansible-828b73dd2dc277d1ac0c4925a66fa21e66aa175d.tar.gz |
Fix: create retry_files_save_path if it doesn't exist (#15659)
* Fix: create retry_files_save_path if it doesn't exist
Ansible documentation states that retry_files_save_path directory will be
created if it does not already exist. It currently doesn't, so this patch
fixes it :)
* Use makedirs_safe to ensure thread-safe dir creation
@bcoca suggested to use the makedirs_safe helper function :)
Diffstat (limited to 'lib/ansible/executor')
-rw-r--r-- | lib/ansible/executor/playbook_executor.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ansible/executor/playbook_executor.py b/lib/ansible/executor/playbook_executor.py index 6f38e8e8bc..8e02441ba0 100644 --- a/lib/ansible/executor/playbook_executor.py +++ b/lib/ansible/executor/playbook_executor.py @@ -27,6 +27,7 @@ from ansible import constants as C from ansible.executor.task_queue_manager import TaskQueueManager from ansible.playbook import Playbook from ansible.template import Templar +from ansible.utils.path import makedirs_safe from ansible.utils.unicode import to_unicode try: @@ -257,6 +258,7 @@ class PlaybookExecutor: re-running on ONLY the failed hosts. This may duplicate some variable information in group_vars/host_vars but that is ok, and expected. ''' + makedirs_safe(os.path.dirname(retry_path)) try: with open(retry_path, 'w') as fd: |