~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ssh.py

  • Committer: Robert J. Tanner
  • Date: 2009-04-20 08:37:32 UTC
  • mfrom: (4299 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4300.
  • Revision ID: tanner@real-time.com-20090420083732-bzx919oo7wpmqc2u
[merge] 1.14rc2 back into bzr.dev (Bob Tanner)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Foundation SSH support for SFTP and smart server."""
19
19
 
20
20
import errno
21
 
import getpass
22
21
import os
23
22
import socket
24
23
import subprocess
458
457
 
459
458
 
460
459
def _paramiko_auth(username, password, host, port, paramiko_transport):
 
460
    auth = config.AuthenticationConfig()
461
461
    # paramiko requires a username, but it might be none if nothing was
462
462
    # supplied.  If so, use the local username.
463
463
    if username is None:
464
 
        username = getpass.getuser()
 
464
        username = auth.get_user('ssh', host, port=port)
465
465
 
466
466
    if _use_ssh_agent:
467
467
        agent = paramiko.Agent()
488
488
            pass
489
489
 
490
490
    # give up and ask for a password
491
 
    auth = config.AuthenticationConfig()
492
491
    password = auth.get_password('ssh', host, username, port=port)
493
492
    try:
494
493
        paramiko_transport.auth_password(username, password)