/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/ssh.py

  • Committer: Andrew Bennetts
  • Date: 2006-11-21 08:19:35 UTC
  • mfrom: (2018.8.1 split smart)
  • mto: (2018.5.35 hpss)
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: andrew.bennetts@canonical.com-20061121081935-6440ef860ef00262
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
try:
40
40
    import paramiko
41
41
except ImportError, e:
42
 
    raise ParamikoNotPresent(e)
 
42
    # If we have an ssh subprocess, we don't strictly need paramiko for all ssh
 
43
    # access
 
44
    paramiko = None
43
45
else:
44
46
    from paramiko.sftp_client import SFTPClient
45
47
 
223
225
            our_server_key_hex = paramiko.util.hexify(our_server_key.get_fingerprint())
224
226
        else:
225
227
            warning('Adding %s host key for %s: %s' % (keytype, host, server_key_hex))
226
 
            if host not in BZR_HOSTKEYS:
227
 
                BZR_HOSTKEYS[host] = {}
228
 
            BZR_HOSTKEYS[host][keytype] = server_key
 
228
            add = getattr(BZR_HOSTKEYS, 'add', None)
 
229
            if add is not None: # paramiko >= 1.X.X
 
230
                BZR_HOSTKEYS.add(host, keytype, server_key)
 
231
            else:
 
232
                BZR_HOSTKEYS.setdefault(host, {})[keytype] = server_key
229
233
            our_server_key = server_key
230
234
            our_server_key_hex = paramiko.util.hexify(our_server_key.get_fingerprint())
231
235
            save_host_keys()
258
262
            self._raise_connection_error(host, port=port, orig_error=e,
259
263
                                         msg='Unable to invoke remote bzr')
260
264
 
261
 
register_ssh_vendor('paramiko', ParamikoVendor())
 
265
if paramiko is not None:
 
266
    register_ssh_vendor('paramiko', ParamikoVendor())
262
267
 
263
268
 
264
269
class SubprocessVendor(SSHVendor):