From 67517e96d39eb2b694e3c05c0937d9c0414d7e54 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 19 Mar 2014 10:30:10 -0400 Subject: [PATCH] Fixes #6567 put the git wrapper script in the module temp dir --- lib/ansible/module_utils/basic.py | 2 ++ library/source_control/git | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 2d85245cc20..43d1f3bccac 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1142,3 +1142,5 @@ class AnsibleModule(object): break return '%.2f %s' % (float(size)/ limit, suffix) +def get_module_path(): + return os.path.dirname(os.path.realpath(__file__)) diff --git a/library/source_control/git b/library/source_control/git index e61c7728156..7b6073a2ee4 100644 --- a/library/source_control/git +++ b/library/source_control/git @@ -143,7 +143,8 @@ import re import tempfile def write_ssh_wrapper(): - fd, wrapper_path = tempfile.mkstemp() + module_dir = get_module_path() + fd, wrapper_path = tempfile.mkstemp(prefix=module_dir + '/') fh = os.fdopen(fd, 'w+b') template = """#!/bin/sh if [ -z "$GIT_SSH_OPTS" ]; then