~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-10-15 21:44:44 UTC
  • mfrom: (3777.1.7 ssh-authconfig)
  • Revision ID: pqm@pqm.ubuntu.com-20081015214444-ztwoizx180edy73v
Enable specifying default ssh username in authentication.conf

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
import warnings
40
40
 
41
41
from bzrlib import (
 
42
    config,
42
43
    errors,
43
44
    urlutils,
44
45
    )
375
376
            password = credentials
376
377
 
377
378
        vendor = ssh._get_ssh_vendor()
 
379
        user = self._user
 
380
        if user is None:
 
381
            auth = config.AuthenticationConfig()
 
382
            user = auth.get_user('ssh', self._host, self._port)
378
383
        connection = vendor.connect_sftp(self._user, password,
379
384
                                         self._host, self._port)
380
 
        return connection, password
 
385
        return connection, (user, password)
381
386
 
382
387
    def _get_sftp(self):
383
388
        """Ensures that a connection is established"""