Skip to content

Commit c4b47fe

Browse files
author
FitzerIRL
committed
Comms fixes
1 parent 13bf879 commit c4b47fe

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

framework/core/commandModules/serialClass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,5 @@ def flush(self) -> bool:
200200
True if can successfully clear the serial console.
201201
"""
202202
self.log.info("Clearing Serial console log")
203-
self.serialCon.flushInput()
203+
self.serialCon.reset_input_buffer()
204204
return True

framework/core/commandModules/sshConsole.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,29 @@ def open(self) -> bool:
6767
"""Open the SSH session.
6868
"""
6969
try:
70-
self.console.connect(self.address, username = self.username, password = self.password, key_filename=self.key, port=self.port)
70+
# Prepare password (convert None to empty string for password-less auth)
71+
password = self.password or ''
72+
73+
# Only use key-based auth if a key file is explicitly provided
74+
if self.key:
75+
self.console.connect(
76+
self.address,
77+
username=self.username,
78+
password=password,
79+
key_filename=self.key,
80+
port=self.port
81+
)
82+
else:
83+
# No key file - use password-only auth (disable automatic key discovery)
84+
self.console.connect(
85+
self.address,
86+
username=self.username,
87+
password=password,
88+
port=self.port,
89+
look_for_keys=False, # Don't try to use SSH keys from ~/.ssh
90+
allow_agent=False # Don't try to use SSH agent
91+
)
92+
7193
self.is_open = True
7294
return True
7395
except Exception as e:

0 commit comments

Comments
 (0)