diff --git a/sdx_controller/handlers/connection_handler.py b/sdx_controller/handlers/connection_handler.py index 87935a8..4a74193 100644 --- a/sdx_controller/handlers/connection_handler.py +++ b/sdx_controller/handlers/connection_handler.py @@ -109,7 +109,11 @@ def _send_breakdown_to_lc(self, breakdown, operation, connection_request): f"Doing '{operation}' operation for '{link}' with exchange_name: {exchange_name}, " f"routing_key: {domain_name}" ) - mq_link = {"operation": operation, "service_id": connection_request.get("id"), "link": link} + mq_link = { + "operation": operation, + "service_id": connection_request.get("id"), + "link": link, + } producer = TopicQueueProducer( timeout=5, exchange_name=exchange_name, routing_key=domain_name ) diff --git a/sdx_controller/handlers/lc_message_handler.py b/sdx_controller/handlers/lc_message_handler.py index 09f65df..e7da3c1 100644 --- a/sdx_controller/handlers/lc_message_handler.py +++ b/sdx_controller/handlers/lc_message_handler.py @@ -29,16 +29,18 @@ def process_lc_json_msg( if not service_id: return - + connection = self.db_instance.read_from_db("connections", service_id) if not connection: return - + connection_json = json.loads(connection[service_id]) connection_json["oxp_response_code"] = msg_json.get("oxp_response_code") connection_json["oxp_response"] = msg_json.get("oxp_response") - self.db_instance.add_key_value_pair_to_db("connections", service_id, json.dumps(connection_json)) + self.db_instance.add_key_value_pair_to_db( + "connections", service_id, json.dumps(connection_json) + ) logger.info("Connection updated: " + service_id) print(self.db_instance.read_from_db("connections", service_id)) return