Set -c local cwd to . if basedir is empty

parent 715d875d
......@@ -48,7 +48,10 @@ class Connection(object):
cmd = "sudo -u {0} -s {1}".format(sudo_user, cmd)
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, stderr = p.communicate()
return ("", stdout, stderr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment