mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Merge branch '3.0' into feature/ai-copilot-bridge
This commit is contained in:
6 files changed
+36
-18
No files matched your search
@@ -556,7 +556,7 @@ class Node:
|
||||
# None properties are not be sent because it can mean the emulator doesn't support it
|
||||
for key, value in list(data.items()):
|
||||
if value is None or value == {} or key in self.CONTROLLER_ONLY_PROPERTIES:
|
||||
del value
|
||||
del data[key]
|
||||
|
||||
return data
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import zipfile
|
||||
import pathlib
|
||||
|
||||
from uuid import UUID, uuid4
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
from .node import Node
|
||||
from .compute import ComputeError
|
||||
@@ -836,7 +837,11 @@ class Project:
|
||||
log.warning(f"Closing project '{self.name}' ignored because it is being loaded")
|
||||
return
|
||||
self._closing = True
|
||||
await self.stop_all()
|
||||
try:
|
||||
await self.stop_all()
|
||||
except HTTPException as e:
|
||||
if not e.status_code == status.HTTP_405_METHOD_NOT_ALLOWED:
|
||||
raise
|
||||
for compute in list(self._project_created_on_compute):
|
||||
try:
|
||||
await compute.post(f"/projects/{self._id}/close", dont_connect=True)
|
||||
@@ -1299,9 +1304,6 @@ class Project:
|
||||
:returns: New node
|
||||
"""
|
||||
|
||||
if node.status != "stopped" and not node.is_always_running():
|
||||
raise ControllerError("Cannot duplicate node data while the node is running")
|
||||
|
||||
data = copy.deepcopy(node.asdict(topology_dump=True))
|
||||
# Some properties like internal ID should not be duplicated
|
||||
for unique_property in (
|
||||
|
||||
Reference in new issue
Block a user