From 5fb2c277a9a8980b169706a0ebe22697f3456e97 Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 05:16:05 +0000 Subject: [PATCH] fix(typing): resolve mypy errors in api.routes.compute.notifications --- gns3server/api/routes/compute/notifications.py | 5 +++-- pyproject.toml | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gns3server/api/routes/compute/notifications.py b/gns3server/api/routes/compute/notifications.py index 2c6ca4ad5..ee533037b 100644 --- a/gns3server/api/routes/compute/notifications.py +++ b/gns3server/api/routes/compute/notifications.py @@ -39,14 +39,15 @@ async def project_ws_notifications(websocket: Union[None, WebSocket] = Depends(w """ if websocket: - log.info(f"New client {websocket.client.host}:{websocket.client.port} has connected to compute WebSocket") + client = f"{websocket.client.host}:{websocket.client.port}" if websocket.client else "unknown" + log.info(f"New client {client} has connected to compute WebSocket") try: with NotificationManager.instance().queue() as queue: while True: notification = await queue.get_json(5) await websocket.send_text(notification) except (ConnectionClosed, WebSocketDisconnect): - log.info(f"Client {websocket.client.host}:{websocket.client.port} has disconnected from compute WebSocket") + log.info(f"Client {client} has disconnected from compute WebSocket") except WebSocketException as e: log.warning(f"Error while sending to controller event to WebSocket client: {e}") diff --git a/pyproject.toml b/pyproject.toml index 5900a66ff..ec44a2882 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -331,7 +331,6 @@ module = [ "gns3server.api.routes.compute.frame_relay_switch_nodes", # 9 "gns3server.api.routes.compute.iou_nodes", # 15 "gns3server.api.routes.compute.nat_nodes", # 10 - "gns3server.api.routes.compute.notifications", # 4 "gns3server.api.routes.compute.projects", # 7 "gns3server.api.routes.compute.qemu_nodes", # 18 "gns3server.api.routes.compute.virtualbox_nodes", # 20