Skip to content

Commit 5bd897f

Browse files
committed
remote/client: Flush the console device only when needed
At present if a console device is used by a strategy driver it is then removed by the client immediately afterwards. If the 'console' command is used, this means that any console data is lost. This is done so that the console device is release for microcom, so move the logic in with the microcom logic. With the forthcoming internal terminal, it will not be needed. Signed-off-by: Simon Glass <sjg@chromium.org>
1 parent c433585 commit 5bd897f

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

labgrid/remote/client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -892,12 +892,6 @@ def _get_target(self, place):
892892
strategy.force(self.args.initial_state)
893893
logging.info("Transitioning into state %s", self.args.state)
894894
strategy.transition(self.args.state)
895-
# deactivate console drivers so we are able to connect with microcom later
896-
try:
897-
con = target.get_active_driver("ConsoleProtocol")
898-
target.deactivate(con)
899-
except NoDriverFoundError:
900-
pass
901895
else:
902896
target = Target(place.name, env=self.env)
903897
RemotePlace(target, name=place.name)
@@ -1032,6 +1026,13 @@ async def _console(self, place, target, timeout, *, logfile=None, loop=False, li
10321026
name = self.args.name
10331027
from ..resource import NetworkSerialPort
10341028

1029+
# deactivate console drivers so we are able to connect with microcom
1030+
try:
1031+
con = target.get_active_driver("ConsoleProtocol")
1032+
target.deactivate(con)
1033+
except NoDriverFoundError:
1034+
pass
1035+
10351036
resource = target.get_resource(NetworkSerialPort, name=name, wait_avail=False)
10361037

10371038
# async await resources

0 commit comments

Comments
 (0)