mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Set -c local cwd to . if basedir is empty
This commit is contained in:
parent
715d875dcb
commit
db1a65342a
1 changed files with 4 additions and 1 deletions
|
@ -48,7 +48,10 @@ class Connection(object):
|
||||||
cmd = "sudo -u {0} -s {1}".format(sudo_user, cmd)
|
cmd = "sudo -u {0} -s {1}".format(sudo_user, cmd)
|
||||||
|
|
||||||
vvv("EXEC %s" % cmd, host=self.host)
|
vvv("EXEC %s" % cmd, host=self.host)
|
||||||
p = subprocess.Popen(cmd, cwd=self.runner.basedir, shell=True, stdin=None,
|
basedir = self.runner.basedir
|
||||||
|
if basedir == '':
|
||||||
|
basedir = '.'
|
||||||
|
p = subprocess.Popen(cmd, cwd=basedir, shell=True, stdin=None,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
return ("", stdout, stderr)
|
return ("", stdout, stderr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue