Commit 439212b7 authored by Javier Diaz's avatar Javier Diaz
Browse files

Debugging

parent 21a3d49c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ def main():
    event_dispatcher = DltEventDispatcher()
    event_dispatcher.start()

    # Context Event dispatcher

    # Starting DLT connector service
    grpc_service = DltConnectorService()
    grpc_service.start()
+3 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ from dlt.connector.client.DltConnectorClient import DltConnectorClient
from .Types import DltRecordTypes

LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)

class DltRecordSender:
    def __init__(self, context_client : ContextClient, dlt_connector_client : Optional[DltConnectorClient]) -> None:
@@ -64,7 +65,8 @@ class DltRecordSender:
        for dlt_record_uuid in self.dlt_record_uuids:
            topology_id,dlt_record = self.dlt_record_uuid_to_data[dlt_record_uuid]
            if isinstance(dlt_record, Device):
                device_id = self.context_client.SetDevice(dlt_record)
                device_id = self.context_client.SetDevice(dlt_record) # Se retriggerea el Evento.
                LOGGER.debug('DEVICE ID: ({:s})'.format(str(dlt_record)))
                if self.dlt_connector_client is None: continue
                dlt_device_id = DltDeviceId()
                dlt_device_id.topology_id.CopyFrom(topology_id)     # pylint: disable=no-member
+2 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ class DLTRecorder(threading.Thread):
        if ((context_uuid == DEFAULT_CONTEXT_NAME) or (context_name == DEFAULT_CONTEXT_NAME)) and \
                (topology_uuid not in topology_uuids) and (topology_name not in topology_uuids):
            for device in topology_details.devices:
                LOGGER.debug('DEVICE INFO({:s})'.format(grpc_message_to_json_string(device)))
                dlt_record_sender.add_device(topology_id, device)

            for link in topology_details.links:
@@ -149,6 +150,7 @@ class DLTRecorder(threading.Thread):
        device = self.context_client.GetDevice(device_id)
        topology_id = self.find_topology_for_device(device_id)
        if topology_id:
            LOGGER.debug('DEVICE INFO({:s}), DEVICE ID ({:s})'.format(grpc_message_to_json_string(device)), (str(device_id)))
            dlt_record_sender.add_device(topology_id, device)
        else:
            LOGGER.warning(f"Topology not found for device {device_id.device_uuid.uuid}")