Change mapping process
Currently, we assign machines to rooms depending on their domain name. For instance, a machine in the domain cisco.kb.sm.cri.epita.fr
will be assigned to the room Cisco
in the site KB
. This won't work for all rooms, as some might be in the same subnet and thus get the same domain. For instance, a machine in Strasbourg will be in stg-irn.sm.cri.epita.fr
and thus we don't know what room it actually is in.
The proposal I make is to add a field currently_mapping
to the Room
model, defaulting to False
. Only one room can be mapping at a time (as we would use that field to know which room the machine is in). As such, we would check that only one room is mapping. We mapping a room, we would have to set that field to True on the room we're mapping. As we might forget to turn it off, I suggest scheduling a task an hour later or so to automatically turn it off.