Browse Source

Handle SSHException

pull/1158/head
Andrea 7 years ago
parent
commit
10a8c3da1c
  1. 4
      auto_backup/models/db_backup.py

4
auto_backup/models/db_backup.py

@ -126,7 +126,9 @@ class DbBackup(models.Model):
# Just open and close the connection # Just open and close the connection
with self.sftp_connection(): with self.sftp_connection():
raise exceptions.Warning(_("Connection Test Succeeded!")) raise exceptions.Warning(_("Connection Test Succeeded!"))
except (pysftp.CredentialException, pysftp.ConnectionException):
except (pysftp.CredentialException,
pysftp.ConnectionException,
pysftp.SSHException):
_logger.info("Connection Test Failed!", exc_info=True) _logger.info("Connection Test Failed!", exc_info=True)
raise exceptions.Warning(_("Connection Test Failed!")) raise exceptions.Warning(_("Connection Test Failed!"))

Loading…
Cancel
Save