~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ssh.py

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import socket
27
27
import subprocess
28
28
import sys
29
 
from binascii import hexlify
30
29
 
31
30
from bzrlib import (
32
31
    config,
277
276
class ParamikoVendor(SSHVendor):
278
277
    """Vendor that uses paramiko."""
279
278
 
280
 
    def _hexify(self, s):
281
 
        return hexlify(s).upper()
282
 
 
283
279
    def _connect(self, username, password, host, port):
284
280
        global SYSTEM_HOSTKEYS, BZR_HOSTKEYS
285
281
 
293
289
            self._raise_connection_error(host, port=port, orig_error=e)
294
290
 
295
291
        server_key = t.get_remote_server_key()
296
 
        server_key_hex = self._hexify(server_key.get_fingerprint())
 
292
        server_key_hex = paramiko.util.hexify(server_key.get_fingerprint())
297
293
        keytype = server_key.get_name()
298
294
        if host in SYSTEM_HOSTKEYS and keytype in SYSTEM_HOSTKEYS[host]:
299
295
            our_server_key = SYSTEM_HOSTKEYS[host][keytype]
300
 
            our_server_key_hex = self._hexify(our_server_key.get_fingerprint())
 
296
            our_server_key_hex = paramiko.util.hexify(
 
297
                our_server_key.get_fingerprint())
301
298
        elif host in BZR_HOSTKEYS and keytype in BZR_HOSTKEYS[host]:
302
299
            our_server_key = BZR_HOSTKEYS[host][keytype]
303
 
            our_server_key_hex = self._hexify(our_server_key.get_fingerprint())
 
300
            our_server_key_hex = paramiko.util.hexify(
 
301
                our_server_key.get_fingerprint())
304
302
        else:
305
303
            trace.warning('Adding %s host key for %s: %s'
306
304
                          % (keytype, host, server_key_hex))
310
308
            else:
311
309
                BZR_HOSTKEYS.setdefault(host, {})[keytype] = server_key
312
310
            our_server_key = server_key
313
 
            our_server_key_hex = self._hexify(our_server_key.get_fingerprint())
 
311
            our_server_key_hex = paramiko.util.hexify(
 
312
                our_server_key.get_fingerprint())
314
313
            save_host_keys()
315
314
        if server_key != our_server_key:
316
315
            filename1 = os.path.expanduser('~/.ssh/known_hosts')
506
505
        agent = paramiko.Agent()
507
506
        for key in agent.get_keys():
508
507
            trace.mutter('Trying SSH agent key %s'
509
 
                         % self._hexify(key.get_fingerprint()))
 
508
                         % paramiko.util.hexify(key.get_fingerprint()))
510
509
            try:
511
510
                paramiko_transport.auth_publickey(username, key)
512
511
                return