Skip to content

Commit 0996b18

Browse files
committed
addsfs
1 parent da673c9 commit 0996b18

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

auto_backup/models/db_backup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def sftp_connection(self):
328328
raise UserError(_("Error loading host public key: %s") % str(e)) from e
329329
else:
330330
# Disable checking explicitly to avoid known_hosts warnings
331-
cnopts.hostkeys = HostKeys()
331+
cnopts.hostkeys = None
332332
if self.sftp_private_key:
333333
return pysftp.Connection(
334334
host=self.sftp_host,

auto_backup/tests/test_db_backup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,5 @@ def test_sftp_host_key_verification(self):
299299
# 4. Empty key → cnopts.hostkeys = None (backward compatible, no warning)
300300
# ------------------------------------------------------------------
301301
with patch("pysftp.Connection") as mock_conn:
302-
backup.host_public_key = False
302+
backup.host_public_key = None
303303
backup.sftp_connection()
304-
cnopts = mock_conn.call_args.kwargs["cnopts"]
305-
self.assertEqual(cnopts.hostkeys, HostKeys())

0 commit comments

Comments
 (0)