1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #1648 from dhozac/local-cwd-basedir

Use runner's basedir as cwd for -c local
This commit is contained in:
Michael DeHaan 2012-11-21 06:40:01 -08:00
commit 82f4aef959

View file

@ -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)