Skip to content

Commit

Permalink
[IMP] auto_backup: minor code clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
Yenthe666 authored Mar 14, 2021
1 parent 541a510 commit ac913e1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions auto_backup/models/db_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def test_sftp_connection(self, context=None):
has_failed = False

for rec in self:
path_to_write_to = rec.sftp_path
ip_host = rec.sftp_host
port_host = rec.sftp_port
username_login = rec.sftp_user
Expand All @@ -95,6 +94,7 @@ def test_sftp_connection(self, context=None):
s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
s.connect(ip_host, port_host, username_login, password_login, timeout=10)
sftp = s.open_sftp()
sftp.close()
message_title = _("Connection Test Succeeded!\nEverything seems properly set up for FTP back-ups!")
except Exception as e:
_logger.critical('There was a problem connecting to the remote ftp: %s', str(e))
Expand Down Expand Up @@ -247,9 +247,7 @@ def schedule_backup(self):
except Exception:
pass

"""
Remove all old files (on local server) in case this is configured..
"""
# Remove all old files (on local server) in case this is configured..
if rec.autoremove:
directory = rec.folder
# Loop over all files in the directory.
Expand Down

0 comments on commit ac913e1

Please sign in to comment.