From e4e3e17f511322ce1f5a5735a071d4518ff5a2f5 Mon Sep 17 00:00:00 2001 From: Charlie Crane Date: Thu, 1 Aug 2024 07:57:01 +0100 Subject: [PATCH] #2706 - commit minor changes from review comments --- src/primaite/simulator/system/services/terminal/terminal.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/primaite/simulator/system/services/terminal/terminal.py b/src/primaite/simulator/system/services/terminal/terminal.py index b6999694..6df21618 100644 --- a/src/primaite/simulator/system/services/terminal/terminal.py +++ b/src/primaite/simulator/system/services/terminal/terminal.py @@ -185,9 +185,11 @@ class Terminal(Service): def login(self, username: str, password: str, ip_address: Optional[IPv4Address] = None) -> bool: """Process User request to login to Terminal. - :param dest_ip_address: The IP address of the node we want to connect to. + If ip_address is passed, login will attempt a remote login to the terminal + :param username: The username credential. :param password: The user password component of credentials. + :param dest_ip_address: The IP address of the node we want to connect to. :return: True if successful, False otherwise. """ if self.operating_state != ServiceOperatingState.RUNNING: @@ -196,6 +198,8 @@ class Terminal(Service): if ip_address: # if ip_address has been provided, we assume we are logging in to a remote terminal. + if ip_address == self.parent.network_interface[1].ip_address: + return self._process_local_login(username=username, password=password) return self._send_remote_login(username=username, password=password, ip_address=ip_address) return self._process_local_login(username=username, password=password)