Island: Make machine model hashable

Machines can be hashed based on their ID. This allows us to add them to set for example and make sure no duplicate entries are there
This commit is contained in:
vakarisz 2022-09-30 11:39:52 +03:00 committed by Kekoa Kaaikala
parent f0f858eba5
commit 9a82e46799
1 changed files with 3 additions and 0 deletions

View File

@ -38,3 +38,6 @@ class Machine(MutableInfectionMonkeyBaseModel):
_make_immutable_sequence = validator("network_interfaces", pre=True, allow_reuse=True)( _make_immutable_sequence = validator("network_interfaces", pre=True, allow_reuse=True)(
make_immutable_sequence make_immutable_sequence
) )
def __hash__(self):
return self.id