mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 06:21:15 +02:00
Pydantic v2 migration
This commit is contained in:
1 parent
11f51b3809
commit
9c456532d0
46 files changed
+221
-277
No files matched your search
@@ -52,12 +52,12 @@ class DynamipsNodeValidation(DynamipsCreate):
|
||||
|
||||
def _check_topology_schema(topo, path):
|
||||
try:
|
||||
Topology.parse_obj(topo)
|
||||
Topology.model_validate(topo)
|
||||
|
||||
# Check the nodes property against compute schemas
|
||||
for node in topo["topology"].get("nodes", []):
|
||||
if node["node_type"] == "dynamips":
|
||||
DynamipsNodeValidation.parse_obj(node.get("properties", {}))
|
||||
DynamipsNodeValidation.model_validate(node.get("properties", {}))
|
||||
|
||||
except pydantic.ValidationError as e:
|
||||
error = f"Invalid data in topology file {path}: {e}"
|
||||
|
||||
Reference in new issue
Block a user