File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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 ())
You can’t perform that action at this time.
0 commit comments