multiprocess (and paramiko)

Roy Smith roy at panix.com
Tue Jun 3 12:43:51 EDT 2014


In article <3c0be3a7-9d2d-4530-958b-13be97db3765 at googlegroups.com>,
 mennis <michaelian.ennis at gmail.com> wrote:

> Here I have a simple multiprocessing class that when initializes takes a 
> connected SSHClient instance and a command to run on the associated host in a 
> new channel.

ChrisA has already answered your question, but to answer the question 
you didn't ask, you probably want to ditch working directly with 
paramiko and take a look at fabric (http://www.fabfile.org/).  It layers 
a really nice interface on top of paramiko.  Instead of gobs of 
low-level paramiko code, you just do something like:

from fabric.api import env, run
env.host_string = "my-remote-hostname.com"
output = run("my command")

and you're done.



More information about the Python-list mailing list