From 51b460e8c6cc3ddff71bf1656c711edfc5631bd8 Mon Sep 17 00:00:00 2001 From: Fred Alger Date: Tue, 5 Jun 2012 10:38:12 -0400 Subject: [PATCH] Make 'fetch' test for local directories before creating. Fixes issue #450 --- lib/ansible/runner/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index c49abf1764..a65ddfe15b 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -481,7 +481,8 @@ class Runner(object): if remote_md5 != local_md5: # create the containing directories, if needed - os.makedirs(os.path.dirname(dest)) + if not os.path.isdir(os.path.dirname(dest)): + os.makedirs(os.path.dirname(dest)) # fetch the file and check for changes conn.fetch_file(source, dest)