Dec-06-2022, 01:59 PM
Hi @wavic
I am facing problem while executing executor.map.
This is my code
I want the commands to run parallely and hence i used executor.map
I am facing problem while executing executor.map.
This is my code
ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(HOSTNAME, port=PORT, username=USERNAME, password=PASSWORD) connection = ssh.invoke_shell() commands =[command1,command2] with concurrent.futures.ThreadPoolExecutor() as executor: executor.map(connection.send, commands) time.sleep(1) result1=connection.recv(600000) print(result1)There is no error while running the above code ,but also there is no execution of commands happening.ie connection.send(command1) and connection.send(command2) are not at all executing and the print is empty
I want the commands to run parallely and hence i used executor.map