mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
Fix: Handle project deletion errors in autoidlepc
When deleting the AUTOIDLEPC project in autoidlepc(), if a remote compute is disconnected, the deletion fails with ControllerForbiddenError due to our compute connection status check. This causes: - The project to remain in the controller's memory - Subsequent autoidlepc calls to fail - User must restart the server to recover This fix adds exception handling to ensure the project is always removed from the controller's memory, even if deletion fails. Related to #2703
This commit is contained in:
parent
9c868911e1
commit
c92188cad4
@ -842,7 +842,14 @@ class Controller:
|
||||
compute = self.get_compute(compute_id)
|
||||
for project in list(self._projects.values()):
|
||||
if project.name == "AUTOIDLEPC":
|
||||
await project.delete()
|
||||
try:
|
||||
await project.delete()
|
||||
except ControllerForbiddenError as e:
|
||||
# Project couldn't be deleted due to disconnected computes
|
||||
log.warning(f"Could not delete AUTOIDLEPC project '{project.id}': {e}")
|
||||
except ControllerError as e:
|
||||
log.warning(f"Error deleting AUTOIDLEPC project '{project.id}': {e}")
|
||||
# Always remove from controller to allow creating a new one
|
||||
self.remove_project(project)
|
||||
project = await self.add_project(name="AUTOIDLEPC")
|
||||
node = await project.add_node(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user