Establish connections to a list of hosts Args: host_info_list (HostInfoList): a list of HostInfo objects workdir (str): the directory where command is executed env (dict): environment variables to propagate to hosts
(self, host_info_list: HostInfoList, workdir: str, env: dict)
| 75 | self.master_recv_conns = {} |
| 76 | |
| 77 | def connect(self, host_info_list: HostInfoList, workdir: str, env: dict) -> None: |
| 78 | """ |
| 79 | Establish connections to a list of hosts |
| 80 | |
| 81 | Args: |
| 82 | host_info_list (HostInfoList): a list of HostInfo objects |
| 83 | workdir (str): the directory where command is executed |
| 84 | env (dict): environment variables to propagate to hosts |
| 85 | """ |
| 86 | for hostinfo in host_info_list: |
| 87 | master_send_conn, worker_recv_conn = Pipe() |
| 88 | master_recv_conn, worker_send_conn = Pipe() |
| 89 | p = Process(target=run_on_host, args=(hostinfo, workdir, worker_recv_conn, worker_send_conn, env)) |
| 90 | p.start() |
| 91 | self.processes[hostinfo.hostname] = p |
| 92 | self.master_recv_conns[hostinfo.hostname] = master_recv_conn |
| 93 | self.master_send_conns[hostinfo.hostname] = master_send_conn |
| 94 | |
| 95 | def send(self, hostinfo: HostInfo, cmd: str) -> None: |
| 96 | """ |
no test coverage detected