mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-26 03:42:22 +02:00
Fix: Add error logging when closing/deleting projects on computes
Previously errors during close() and delete_on_computes() were silently swallowed without any logging, making it difficult to diagnose failures when remote computes are unreachable. - close(): log warning instead of silent pass - delete_on_computes(): wrap HTTP DELETE in try/except with warning log Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4d06b2b7b6
commit
8ecd449dd8
@ -890,9 +890,8 @@ class Project:
|
|||||||
for compute in list(self._project_created_on_compute):
|
for compute in list(self._project_created_on_compute):
|
||||||
try:
|
try:
|
||||||
await compute.post(f"/projects/{self._id}/close", dont_connect=True)
|
await compute.post(f"/projects/{self._id}/close", dont_connect=True)
|
||||||
# We don't care if a compute is down at this step
|
except (ComputeError, ControllerError, TimeoutError) as e:
|
||||||
except (ComputeError, ControllerError, TimeoutError):
|
log.warning(f"Could not close project '{self._id}' on compute '{compute.id}': {e}")
|
||||||
pass
|
|
||||||
self._clean_pictures()
|
self._clean_pictures()
|
||||||
self._status = "closed"
|
self._status = "closed"
|
||||||
if not ignore_notification:
|
if not ignore_notification:
|
||||||
@ -1075,7 +1074,10 @@ class Project:
|
|||||||
"""
|
"""
|
||||||
for compute in list(self._project_created_on_compute):
|
for compute in list(self._project_created_on_compute):
|
||||||
if compute.id != "local":
|
if compute.id != "local":
|
||||||
await compute.delete(f"/projects/{self._id}")
|
try:
|
||||||
|
await compute.delete(f"/projects/{self._id}")
|
||||||
|
except (ComputeError, TimeoutError) as e:
|
||||||
|
log.warning(f"Could not delete project '{self._id}' on compute '{compute.id}': {e}")
|
||||||
self._project_created_on_compute.remove(compute)
|
self._project_created_on_compute.remove(compute)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user