~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

Don't import ui_factory directly, in case it gets changed later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
from bzrlib.config import config_dir
37
37
from bzrlib.trace import mutter, warning, error
38
38
from bzrlib.transport import Transport, register_transport
39
 
from bzrlib.ui import ui_factory
 
39
import bzrlib.ui
40
40
 
41
41
try:
42
42
    import paramiko
734
734
            #self._password = None
735
735
 
736
736
        # give up and ask for a password
737
 
        password = ui_factory.get_password(prompt='SSH %(user)s@%(host)s password',
738
 
                                           user=username, host=self._host)
 
737
        password = bzrlib.ui.ui_factory.get_password(
 
738
                prompt='SSH %(user)s@%(host)s password',
 
739
                user=username, host=self._host)
739
740
        try:
740
741
            transport.auth_password(username, password)
741
742
        except paramiko.SSHException:
749
750
            transport.auth_publickey(username, key)
750
751
            return True
751
752
        except paramiko.PasswordRequiredException:
752
 
            password = ui_factory.get_password(prompt='SSH %(filename)s password',
753
 
                                               filename=filename)
 
753
            password = bzrlib.ui.ui_factory.get_password(
 
754
                    prompt='SSH %(filename)s password',
 
755
                    filename=filename)
754
756
            try:
755
757
                key = pkey_class.from_private_key_file(filename, password)
756
758
                transport.auth_publickey(username, key)