~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Aaron Bentley
  • Date: 2006-06-17 19:01:15 UTC
  • mfrom: (1786 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1787.
  • Revision ID: abentley@panoramicfeedback.com-20060617190115-81ab9bbc7aebcf8a
MergeĀ fromĀ dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
702
702
        vendor = _get_ssh_vendor()
703
703
        if vendor == 'loopback':
704
704
            sock = socket.socket()
705
 
            sock.connect((self._host, self._port))
 
705
            try:
 
706
                sock.connect((self._host, self._port))
 
707
            except socket.error, e:
 
708
                raise ConnectionError('Unable to connect to SSH host %s:%s: %s'
 
709
                                      % (self._host, self._port, e))
706
710
            self._sftp = SFTPClient(LoopbackSFTP(sock))
707
711
        elif vendor != 'none':
708
712
            sock = SFTPSubprocess(self._host, vendor, self._port,
723
727
            t.set_log_channel('bzr.paramiko')
724
728
            t.start_client()
725
729
        except paramiko.SSHException, e:
726
 
            raise ConnectionError('Unable to reach SSH host %s:%d' %
727
 
                                  (self._host, self._port), e)
 
730
            raise ConnectionError('Unable to reach SSH host %s:%s: %s' 
 
731
                                  % (self._host, self._port, e))
728
732
            
729
733
        server_key = t.get_remote_server_key()
730
734
        server_key_hex = paramiko.util.hexify(server_key.get_fingerprint())
971
975
        self._listener.stop()
972
976
        _ssh_vendor = self._original_vendor
973
977
 
 
978
    def get_bogus_url(self):
 
979
        """See bzrlib.transport.Server.get_bogus_url."""
 
980
        # this is chosen to try to prevent trouble with proxies, wierd dns,
 
981
        # etc
 
982
        return 'sftp://127.0.0.1:1/'
 
983
 
 
984
 
974
985
 
975
986
class SFTPFullAbsoluteServer(SFTPServer):
976
987
    """A test server for sftp transports, using absolute urls and ssh."""