plugin: sftp transport
John A Meinel
john at arbash-meinel.com
Tue Oct 18 23:01:31 BST 2005
> Here's a plugin for SFTP branch support using paramiko. It works as
> of at least bzr.dev at 1310, but the Transport interface seems to be in
> flux so... "Past performance does not guarantee future results." ;)
>
> It requires at least verison 1.4 of paramiko, though 1.5 is probably
> better:
> http://www.lag.net/paramiko/
I've looked over the code (briefly), and generally it looks good. I'm a
little curious why you have the global SYSTEM_HOST_KEYS loaded into
save_host_keys(), but you don't use it.
Also, I would think that in _sftp_connect() we would preferentially use
"BZR_HOST_KEYS" over using SYSTEM_HOST_KEYS, since we are BZR, but this
probably isn't a big deal.
I also noticed that you never disconnect from the remote host. Now, I
don't know if the disconnect automatically happens when the last reference
to self._sftp goes away, which is perfectly fine.
We might also consider having a weakref dictionary of remote hosts that we
are currently connected to, and their connection object. I know that I
believe everything will be called through "clone()" but I suppose it would
be possible for a second connection to be attempted. A weakref dictionary
lets you use the connection if it exists, but it also doesn't hang on to
it (letting it disconnect) when all real references go away.
Otherwise, kudos again, it looks good to me. Certainly your FIXME
statements should be looked into, but if it works for now, that is
certainly a good start.
John
=:->
More information about the bazaar
mailing list