diff --git a/monkey/monkey_island/cc/island_event_handlers/handle_agent_registration.py b/monkey/monkey_island/cc/island_event_handlers/handle_agent_registration.py index c9bf5f611..363335c5f 100644 --- a/monkey/monkey_island/cc/island_event_handlers/handle_agent_registration.py +++ b/monkey/monkey_island/cc/island_event_handlers/handle_agent_registration.py @@ -59,15 +59,11 @@ class handle_agent_registration: return None - def _upsert_machine( - self, existing_machine: Machine, agent_registration_data: AgentRegistrationData - ): - updated_machine = existing_machine.copy() + def _upsert_machine(self, machine: Machine, agent_registration_data: AgentRegistrationData): + self._update_hardware_id(machine, agent_registration_data) + self._update_network_interfaces(machine, agent_registration_data) - self._update_hardware_id(updated_machine, agent_registration_data) - self._update_network_interfaces(updated_machine, agent_registration_data) - - self._machine_repository.upsert_machine(updated_machine) + self._machine_repository.upsert_machine(machine) def _update_hardware_id(self, machine: Machine, agent_registration_data: AgentRegistrationData): if (