Skip to content

Commit

Permalink
SFTPStorage: catch IOError in .delete
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneier committed Aug 26, 2018
1 parent 0effd3d commit c2c8f00
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions storages/backends/sftpstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,14 @@ def _save(self, name, content):
return name

def delete(self, name):
remote_path = self._remote_path(name)
self.sftp.remove(remote_path)
try:
self.sftp.remove(self._remote_path(name))
except IOError:
pass

def exists(self, name):
# Try to retrieve file info. Return true on success, false on failure.
remote_path = self._remote_path(name)

try:
self.sftp.stat(remote_path)
self.sftp.stat(self._remote_path(name))
return True
except IOError:
return False
Expand Down

0 comments on commit c2c8f00

Please sign in to comment.