I was looking on Paramiko (http://www.lag.net/paramiko/)
and was thinking maybe we could do the automatic remote server creation with
it.
In a way that it would be platform interdependent, cause the
current solution (that thomas add, and i'm not saying it a bad one, it's
quite nifty) will work only under linux flavor python.
yes the paramikio is depended on pycrypto which is not a pure python
this means that the user would need to install a binary package, or compile
it on it's own.
I thought of something like that: [it's totally pseudo code, and it's not
working on win32, cause paramiko files(stdout,stdin), are not behaving like
a win32pipe]
# paramiko.sftpclient to send the Rpyc module remotely
t = paramiko.Transport((hostname, port))
t.connect(username=username, password=password, hostkey=hostkey)
sftp = paramiko.SFTPClient.from_transport(t)
# TODO: handle the file that needed to be sent away
#paramiko.sshclient to start the process on the other side
ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname="127.0.0.1", port=port, username=username,
password=password)
ssh.invoke_shell()
#TODO: better way of starting rpyc, maybe using SSL sockets
command = """python -c "import rpyc
rpyc.classic.connect_stdpipes().serve_all()"
"""
stdin, stdout, stderr = ssh.exec_command(command)
# start the client side
c = rpyc.Connection(rpyc.SlaveService,
rpyc.Channel(rpyc.PipeStream(stdout, stdin)),{})
any thoughts ? or to make it actually work, and easy to use ?
Fruch