Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automate MML Commands
#11
Hi @wavic
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  1. How can I automate this batch creation of documents? 2. How can I automate posting SamLearnsPython 2 3,471 Jul-02-2018, 11:36 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020