From 65b82f69e4456c8f6521fbec9af769092fe0b2e0 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 2 Jun 2015 23:39:57 -0400 Subject: [PATCH] avoid failing when mode is none --- lib/ansible/utils/path.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils/path.py b/lib/ansible/utils/path.py index ac5160402b..b271e7ed4b 100644 --- a/lib/ansible/utils/path.py +++ b/lib/ansible/utils/path.py @@ -41,7 +41,10 @@ def makedirs_safe(path, mode=None): '''Safe way to create dirs in muliprocess/thread environments''' if not os.path.exists(path): try: - os.makedirs(path, mode) + if mode: + os.makedirs(path, mode) + else: + os.makedirs(path) except OSError, e: if e.errno != EEXIST: raise