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): ...@@ -141,7 +141,7 @@ class SFTPFS(FS):
except paramiko.SSHException: except paramiko.SSHException:
pass pass
if not connection.is_authenticated(): elif not connection.is_authenticated():
if not username: if not username:
username = getuser() username = getuser()
try: try:
...@@ -158,16 +158,16 @@ class SFTPFS(FS): ...@@ -158,16 +158,16 @@ class SFTPFS(FS):
try: try:
connection.auth_none(username) connection.auth_none(username)
except paramiko.BadAuthenticationType, e: except paramiko.BadAuthenticationType, e:
connection.close() self.close()
allowed = ', '.join(e.allowed_types) allowed = ', '.join(e.allowed_types)
raise RemoteConnectionError(msg='no auth - server requires one of the following: %s' % allowed, details=e) raise RemoteConnectionError(msg='no auth - server requires one of the following: %s' % allowed, details=e)
if not connection.is_authenticated(): if not connection.is_authenticated():
connection.close() self.close()
raise RemoteConnectionError(msg='no auth') raise RemoteConnectionError(msg='no auth')
except paramiko.SSHException, e: except paramiko.SSHException, e:
connection.close() self.close()
raise RemoteConnectionError(msg='SSH exception (%s)' % str(e), details=e) raise RemoteConnectionError(msg='SSH exception (%s)' % str(e), details=e)
self._transport = connection 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