lib.SSHClientInternal: No key_filename in connect()

Remove the key_filename parameter from the call to Paramiko's
connect(). It's user-dependent, and the current DevOps implementation
relies on having a SSH_AUTH_SOCK in the environment, anyway.

Signed-off-by: janware DevOps <devops@janware.com>
This commit is contained in:
DevOps 2026-03-20 08:14:59 +00:00 committed by Jan Lindemann
commit f2ffe85b61

View file

@ -106,9 +106,11 @@ class SSHClientInternal(SSHClient): # export
import paramiko # type: ignore # error: Library stubs not installed for "paramiko" import paramiko # type: ignore # error: Library stubs not installed for "paramiko"
ret = paramiko.SSHClient() ret = paramiko.SSHClient()
ret.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ret.set_missing_host_key_policy(paramiko.AutoAddPolicy())
path_to_key=os.path.join(os.environ['HOME'], '.ssh', 'id_rsa')
try: try:
ret.connect(self.hostname, key_filename=path_to_key, allow_agent=True) ret.connect(
hostname=self.hostname,
allow_agent=True
)
except Exception as e: except Exception as e:
log(ERR, f'Failed to connect to {self.hostname} with key file {path_to_key} ({str(e)})') log(ERR, f'Failed to connect to {self.hostname} with key file {path_to_key} ({str(e)})')
raise raise