Commit e24d7a4a by willmcgugan

Tweaks. Going to bed now. Hope I haven't frakked up the tests

parent b6c21954
......@@ -141,7 +141,7 @@ class SFTPFS(FS):
except paramiko.SSHException:
pass
if not connection.is_authenticated():
elif not connection.is_authenticated():
if not username:
username = getuser()
try:
......@@ -158,16 +158,16 @@ class SFTPFS(FS):
try:
connection.auth_none(username)
except paramiko.BadAuthenticationType, e:
connection.close()
self.close()
allowed = ', '.join(e.allowed_types)
raise RemoteConnectionError(msg='no auth - server requires one of the following: %s' % allowed, details=e)
if not connection.is_authenticated():
connection.close()
self.close()
raise RemoteConnectionError(msg='no auth')
except paramiko.SSHException, e:
connection.close()
self.close()
raise RemoteConnectionError(msg='SSH exception (%s)' % str(e), details=e)
self._transport = connection
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment