From bdf05ec9a04005ce7c5e39eb5d0e6fbe0ccd618b Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 20 Nov 2012 15:36:43 +0100 Subject: [PATCH] Use runner's basedir as cwd for -c local --- lib/ansible/runner/connection_plugins/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/connection_plugins/local.py b/lib/ansible/runner/connection_plugins/local.py index f1ae2e0804..52d0a158f1 100644 --- a/lib/ansible/runner/connection_plugins/local.py +++ b/lib/ansible/runner/connection_plugins/local.py @@ -48,7 +48,7 @@ class Connection(object): cmd = "sudo -u {0} -s {1}".format(sudo_user, cmd) vvv("EXEC %s" % cmd, host=self.host) - p = subprocess.Popen(cmd, shell=True, stdin=None, + p = subprocess.Popen(cmd, cwd=self.runner.basedir, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate() return ("", stdout, stderr)