From 7bfa36eb8b0c2c7751c2cd4d94f44542aae5b11d Mon Sep 17 00:00:00 2001 From: Andrea Tartaglia Date: Fri, 16 Sep 2016 16:19:43 +0100 Subject: [PATCH] Pass the absolute path to dirname when assigning basedir (#17457) * Pass the absolute path to dirname when assigning basedir If no path is specified when calling the playbook, os.path.dirname(playbook_path) returns '' This will cause failure when creating the retry file. Fixes #17456 * Updated to use os.pathdirname(os.path.abspath()) --- lib/ansible/executor/playbook_executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/executor/playbook_executor.py b/lib/ansible/executor/playbook_executor.py index 12a9e09260d..79e2843d1e0 100644 --- a/lib/ansible/executor/playbook_executor.py +++ b/lib/ansible/executor/playbook_executor.py @@ -187,7 +187,7 @@ class PlaybookExecutor: if C.RETRY_FILES_SAVE_PATH: basedir = C.shell_expand(C.RETRY_FILES_SAVE_PATH) elif playbook_path: - basedir = os.path.dirname(playbook_path) + basedir = os.path.dirname(os.path.abspath(playbook_path)) else: basedir = '~/'