104
# don't use prefetch unless paramiko version >= 1.5.2 (there were bugs earlier)
105
_default_do_prefetch = False
106
if getattr(paramiko, '__version_info__', (0, 0, 0)) >= (1, 5, 5):
107
_default_do_prefetch = True
104
_paramiko_version = getattr(paramiko, '__version_info__', (0, 0, 0))
105
# don't use prefetch unless paramiko version >= 1.5.5 (there were bugs earlier)
106
_default_do_prefetch = (_paramiko_version >= (1, 5, 5))
109
108
# Paramiko 1.5 tries to open a socket.AF_UNIX in order to connect
110
109
# to ssh-agent. That attribute doesn't exist on win32 (it does in cygwin)
111
110
# so we get an AttributeError exception. So we will not try to
112
111
# connect to an agent if we are on win32 and using Paramiko older than 1.6
113
_use_win32_ssh_agent = False
114
if getattr(paramiko, '__version_info__', (0, 0, 0)) >= (1, 6, 0):
115
_use_win32_ssh_agent = True
112
_use_ssh_agent = (sys.platform != 'win32' or _paramiko_version >= (1, 6, 0))
118
115
_ssh_vendor = None
782
779
# Also, it would mess up the self.relpath() functionality
783
780
username = self._username or getpass.getuser()
785
if sys.platform != 'win32' or _use_win32_ssh_agent:
786
783
agent = paramiko.Agent()
787
784
for key in agent.get_keys():
788
785
mutter('Trying SSH agent key %s' % paramiko.util.hexify(key.get_fingerprint()))