forked from p15670423/monkey
Island: Modify machine with AgentRegistrationData
Since the Machine is passed to other methods, it should have the most up to date data.
This commit is contained in:
parent
4101f7509a
commit
271475570d
|
@ -59,15 +59,11 @@ class handle_agent_registration:
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _upsert_machine(
|
def _upsert_machine(self, machine: Machine, agent_registration_data: AgentRegistrationData):
|
||||||
self, existing_machine: Machine, agent_registration_data: AgentRegistrationData
|
self._update_hardware_id(machine, agent_registration_data)
|
||||||
):
|
self._update_network_interfaces(machine, agent_registration_data)
|
||||||
updated_machine = existing_machine.copy()
|
|
||||||
|
|
||||||
self._update_hardware_id(updated_machine, agent_registration_data)
|
self._machine_repository.upsert_machine(machine)
|
||||||
self._update_network_interfaces(updated_machine, agent_registration_data)
|
|
||||||
|
|
||||||
self._machine_repository.upsert_machine(updated_machine)
|
|
||||||
|
|
||||||
def _update_hardware_id(self, machine: Machine, agent_registration_data: AgentRegistrationData):
|
def _update_hardware_id(self, machine: Machine, agent_registration_data: AgentRegistrationData):
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue