I am trying to get output from Telnet and SSH hosts for some commands and store them in a shelf. Since there are many commands, I am using multiprocessing. I have the following important methods:
connectToHost
: Making a connection (SSH/ Telnet) using a method.ExecuteCommand
: executing the command and getting the output.main
: where I am iterating over all the commands and getting the output in a dictionary usingmultiprocessing
. This method calls another method which merges the outputs from other processes.
For Telnet, everything works fine but when it is an SSH connection, I the code is failing at the process.start()
and I am getting following error.
TypeError: can't pickle CompiledFFI objects
Why is it not working for SSH even when I am calling the same methods? how to fix this?