From aeca5fb6a27efb77dd588e78f6815d056c5db8da Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Mon, 19 Aug 2024 10:28:39 +0100 Subject: [PATCH] #2769 - Clean up incorrect names and commented out code [skip ci] --- src/primaite/game/agent/actions.py | 2 +- .../system/services/terminal/terminal.py | 30 ------------------- tests/conftest.py | 2 +- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/src/primaite/game/agent/actions.py b/src/primaite/game/agent/actions.py index d588c018..2a0c5351 100644 --- a/src/primaite/game/agent/actions.py +++ b/src/primaite/game/agent/actions.py @@ -1201,7 +1201,7 @@ class ActionManager: "CONFIGURE_DOSBOT": ConfigureDoSBotAction, "NODE_ACCOUNTS_CHANGE_PASSWORD": NodeAccountsChangePasswordAction, "SSH_TO_REMOTE": NodeSessionsRemoteLoginAction, - "SSH_LOGOUT_LOGOUT": NodeSessionsRemoteLogoutAction, + "SESSIONS_REMOTE_LOGOFF": NodeSessionsRemoteLogoutAction, "NODE_SEND_REMOTE_COMMAND": NodeSendRemoteCommandAction, } """Dictionary which maps action type strings to the corresponding action class.""" diff --git a/src/primaite/simulator/system/services/terminal/terminal.py b/src/primaite/simulator/system/services/terminal/terminal.py index 79dc698f..406facd1 100644 --- a/src/primaite/simulator/system/services/terminal/terminal.py +++ b/src/primaite/simulator/system/services/terminal/terminal.py @@ -164,36 +164,6 @@ class Terminal(Service): def _init_request_manager(self) -> RequestManager: """Initialise Request manager.""" rm = super()._init_request_manager() - # rm.add_request( - # "send", - # request_type=RequestType(func=lambda request, context: RequestResponse.from_bool(self.send())), - # ) - - # def _login(request: RequestFormat, context: Dict) -> RequestResponse: - # login = self._process_local_login(username=request[0], password=request[1]) - # if login: - # return RequestResponse( - # status="success", - # data={ - # "ip_address": login.ip_address, - # }, - # ) - # else: - # return RequestResponse(status="failure", data={"reason": "Invalid login credentials"}) - # - # rm.add_request( - # "Login", - # request_type=RequestType(func=_login), - # ) - - # def _logoff(request: RequestFormat, context: Dict) -> RequestResponse: - # """Logoff from connection.""" - # connection_uuid = request[0] - # self.parent.user_session_manager.local_logout(connection_uuid) - # self._disconnect(connection_uuid) - # return RequestResponse(status="success", data={}) - # - # rm.add_request("Logoff", request_type=RequestType(func=_logoff)) def _remote_login(request: RequestFormat, context: Dict) -> RequestResponse: login = self._send_remote_login(username=request[0], password=request[1], ip_address=request[2]) diff --git a/tests/conftest.py b/tests/conftest.py index 2ae6299d..abc851c5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -460,7 +460,7 @@ def game_and_agent(): {"type": "NETWORK_PORT_DISABLE"}, {"type": "NODE_ACCOUNTS_CHANGE_PASSWORD"}, {"type": "SSH_TO_REMOTE"}, - {"type": "SSH_LOGOUT_LOGOUT"}, + {"type": "SESSIONS_REMOTE_LOGOFF"}, {"type": "NODE_SEND_REMOTE_COMMAND"}, ]