From 5bb7896242f00890e2610690e14403c6e92cbe0d Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 04:42:04 +0000 Subject: [PATCH 1/3] fix(typing): resolve mypy errors in api.routes.compute.capabilities --- gns3server/api/routes/compute/capabilities.py | 3 ++- pyproject.toml | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/api/routes/compute/capabilities.py b/gns3server/api/routes/compute/capabilities.py index f472f6231..42154d4e1 100644 --- a/gns3server/api/routes/compute/capabilities.py +++ b/gns3server/api/routes/compute/capabilities.py @@ -39,7 +39,8 @@ def get_capabilities(request: Request) -> dict: node_types.extend(module.node_types()) # record the controller hostname or IP address - request.app.state.controller_host = request.client.host + if request.client: + request.app.state.controller_host = request.client.host return { "version": __version__, diff --git a/pyproject.toml b/pyproject.toml index 5f0789a77..fadae6ec9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -322,7 +322,6 @@ module = [ "gns3server.agent.web_wireshark.manager", # 9 "gns3server.agent.web_wireshark.stats", # 4 "gns3server.api.routes.compute.atm_switch_nodes", # 9 - "gns3server.api.routes.compute.capabilities", # 1 "gns3server.api.routes.compute.cloud_nodes", # 14 "gns3server.api.routes.compute.compute", # 1 "gns3server.api.routes.compute.dependencies.authentication", # 3 From f94a0cae0d8f026f5c4c790ae90350c961b4f088 Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 04:41:45 +0000 Subject: [PATCH 2/3] fix(typing): resolve mypy errors in api.routes.compute.compute --- gns3server/api/routes/compute/compute.py | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gns3server/api/routes/compute/compute.py b/gns3server/api/routes/compute/compute.py index 1a862787c..c98b1a256 100644 --- a/gns3server/api/routes/compute/compute.py +++ b/gns3server/api/routes/compute/compute.py @@ -163,7 +163,7 @@ def compute_statistics() -> dict: @router.get("/qemu/capabilities") async def get_qemu_capabilities() -> dict: - capabilities = {"kvm": []} + capabilities: dict[str, list] = {"kvm": []} kvms = await Qemu.get_kvm_archs() if kvms: capabilities["kvm"] = kvms diff --git a/pyproject.toml b/pyproject.toml index fadae6ec9..5900a66ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -323,7 +323,6 @@ module = [ "gns3server.agent.web_wireshark.stats", # 4 "gns3server.api.routes.compute.atm_switch_nodes", # 9 "gns3server.api.routes.compute.cloud_nodes", # 14 - "gns3server.api.routes.compute.compute", # 1 "gns3server.api.routes.compute.dependencies.authentication", # 3 "gns3server.api.routes.compute.docker_nodes", # 26 "gns3server.api.routes.compute.dynamips_nodes", # 9 From 5fb2c277a9a8980b169706a0ebe22697f3456e97 Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 05:16:05 +0000 Subject: [PATCH 3/3] 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