From 76c30ea0ef8229f00f4ce303b02ce3818122a464 Mon Sep 17 00:00:00 2001 From: zbeacon Date: Fri, 17 Jan 2020 11:47:20 +0200 Subject: [PATCH] Refactored logging for received remote configuration --- .../gateway/tb_gateway_remote_configurator.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/thingsboard_gateway/gateway/tb_gateway_remote_configurator.py b/thingsboard_gateway/gateway/tb_gateway_remote_configurator.py index 621433c6..df0ff1be 100644 --- a/thingsboard_gateway/gateway/tb_gateway_remote_configurator.py +++ b/thingsboard_gateway/gateway/tb_gateway_remote_configurator.py @@ -38,13 +38,16 @@ class RemoteConfigurator: self.__new_event_storage = None def process_configuration(self, configuration): - decoded_configuration = b64decode(configuration) - log.info("Remote configuration received: \n %s", dumps(decoded_configuration)) - self.__new_configuration = loads(decoded_configuration) - self.__old_connectors_configs = self.__gateway._connectors_configs - self.__new_general_configuration_file = self.__new_configuration.get("thingsboard") - self.__process_connectors_configuration() - self.send_current_configuration() + try: + decoded_configuration = b64decode(configuration) + log.info("Remote configuration received: \n %s", decoded_configuration) + self.__new_configuration = loads(decoded_configuration) + self.__old_connectors_configs = self.__gateway._connectors_configs + self.__new_general_configuration_file = self.__new_configuration.get("thingsboard") + self.__process_connectors_configuration() + self.send_current_configuration() + except Exception as e: + log.exception(e) def send_current_configuration(self): current_configuration = {}