diff --git a/daemon/core/emulator/session.py b/daemon/core/emulator/session.py index 124637cb..436f80c1 100644 --- a/daemon/core/emulator/session.py +++ b/daemon/core/emulator/session.py @@ -728,27 +728,12 @@ class Session: self.state = state self.state_time = time.monotonic() logger.info("changing session(%s) to state %s", self.id, state.name) - self.write_state(state) self.run_hooks(state) self.run_state_hooks(state) if send_event: event_data = EventData(event_type=state, time=str(time.monotonic())) self.broadcast_event(event_data) - def write_state(self, state: EventTypes) -> None: - """ - Write the state to a state file in the session dir. - - :param state: state to write to file - :return: nothing - """ - state_file = self.directory / "state" - try: - with state_file.open("w") as f: - f.write(f"{state.value} {state.name}\n") - except IOError: - logger.exception("error writing state file: %s", state.name) - def run_hooks(self, state: EventTypes) -> None: """ Run hook scripts upon changing states. If hooks is not specified, run all hooks diff --git a/daemon/tests/conftest.py b/daemon/tests/conftest.py index ed56dc95..b668fb07 100644 --- a/daemon/tests/conftest.py +++ b/daemon/tests/conftest.py @@ -59,7 +59,6 @@ def patcher(request): LinuxNetClient, "get_mac", return_value="00:00:00:00:00:00" ) patch_manager.patch_obj(CoreNode, "create_file") - patch_manager.patch_obj(Session, "write_state") yield patch_manager patch_manager.shutdown()