Esempio n. 1
0
 def _update_device_mapping(
     self,
     client_ip: str,
     inform: models.Inform,
 ) -> None:
     """
     When receiving an Inform message, we can figure out what device we
     are talking to. We can also see if the IP has changed, and the
     StateMachineManager must track this so that subsequent tr069
     messages can be handled correctly.
     """
     enb_serial = self._parse_msg_for_serial(inform)
     if enb_serial is None:
         raise UnrecognizedEnodebError(
             'eNB does not have serial number '
             'under expected param path',
         )
     if not is_enb_registered(self._service.mconfig, enb_serial):
         raise UnrecognizedEnodebError(
             'eNB not registered to this Access '
             'Gateway (serial #%s)' % enb_serial,
         )
     self._associate_serial_to_ip(client_ip, enb_serial)
     handler = self._get_handler(client_ip)
     if handler is None:
         device_name = get_device_name_from_inform(inform)
         handler = self._build_handler(device_name)
         self._state_machine_by_ip[client_ip] = handler
Esempio n. 2
0
 def _update_device_mapping(
     self,
     client_ip: str,
     inform: models.Inform,
 ) -> None:
     """
     When receiving an Inform message, we can figure out what device we
     are talking to. We can also see if the IP has changed, and the
     StateMachineManager must track this so that subsequent tr069
     messages can be handled correctly.
     """
     enb_serial = self._parse_msg_for_serial(inform)
     self._associate_serial_to_ip(client_ip, enb_serial)
     handler = self._get_handler(client_ip)
     if handler is None:
         device_name = get_device_name_from_inform(inform)
         handler = self._build_handler(device_name)
         self._state_machine_by_ip[client_ip] = handler