fix(TaskPool):修复执行ssh命令时找不到ssh可执行文件的问题

This commit is contained in:
vimiix
2023-04-11 10:33:32 +08:00
parent 12c545f101
commit bb0c2f678c

View File

@ -277,8 +277,9 @@ class TaskThread(threading.Thread):
".bashrc")
ssh_auth_sock = self.get_env_variable("SSH_AUTH_SOCK", bashrc_file)
ssh_agent_pid = self.get_env_variable("SSH_AGENT_PID", bashrc_file)
env = {"SSH_AUTH_SOCK": ssh_auth_sock,
"SSH_AGENT_PID": ssh_agent_pid}
env = os.environ
env.update({"SSH_AUTH_SOCK": ssh_auth_sock,
"SSH_AGENT_PID": ssh_agent_pid})
self.proc = FastPopen(self.cmd, shell=False, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, env=env,
close_fds=True)