ssh woes on windows

Mark Hammond mhammond at skippinet.com.au
Sat Jun 28 04:38:05 BST 2008


Looking at this a little more:

> I thought at one point we disabled plink from being autodetected
> because we can't pass it a password. Was the previous autodetect behavior
> restored?
> 
> Put another way, we disabled plink unless people explicitly requested
> it, in favor of always using paramiko (since it can talk to pageant
> anyway). I don't know why this would have changed.

get_vendor() in ssh.py first checks the environment, then it does the _get_vendor_by_inspection() thing, and if that fails, it falls back to _default_ssh_vendor, which is paramiko.

_get_vendor_by_inspection() searches for ssh.exe and plink.exe on the path. It seems to me that it makes sense for _get_vendor_by_inspection() to come *last* - only if there is no paramiko available should we fallback to searching.  Something like:

=== modified file 'bzrlib/transport/ssh.py'
--- bzrlib/transport/ssh.py     2008-04-24 07:22:53 +0000
+++ bzrlib/transport/ssh.py     2008-06-28 03:35:52 +0000
@@ -148,13 +148,14 @@
         """
         if self._cached_ssh_vendor is None:
             vendor = self._get_vendor_by_environment(environment)
+            if vendor is None and self._default_ssh_vendor is not None:
+                trace.mutter('using default ssh implementation')
+                vendor = self._default_ssh_vendor
             if vendor is None:
+                trace.mutter('falling back to searching for a suitable ssh')
                 vendor = self._get_vendor_by_inspection()
                 if vendor is None:
-                    trace.mutter('falling back to default implementation')
-                    vendor = self._default_ssh_vendor
-                    if vendor is None:
-                        raise errors.SSHVendorNotFound()
+                    raise errors.SSHVendorNotFound()
             self._cached_ssh_vendor = vendor
         return self._cached_ssh_vendor

@@ -355,6 +356,7 @@
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE,
                                 **os_specific_subprocess_params())
+        trace.mutter("spawning %s -> %s", argv, proc)
         return SSHSubprocess(proc)

     def connect_sftp(self, username, password, host, port):

Mark




More information about the bazaar mailing list