1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-12 19:38:57 +00:00

Fix bug when creating Dynamips router with chassis setting

This commit is contained in:
grossmj 2022-12-24 18:03:00 +08:00
parent 00691390eb
commit 8ad7b3f613

View File

@ -61,9 +61,11 @@ async def create_router(project_id: UUID, node_data: schemas.DynamipsCreate) ->
dynamips_manager = Dynamips.instance()
platform = node_data.platform
chassis = None
print(node_data.chassis, platform in DEFAULT_CHASSIS)
if not node_data.chassis and platform in DEFAULT_CHASSIS:
chassis = DEFAULT_CHASSIS[platform]
else:
chassis = node_data.chassis
node_data = jsonable_encoder(node_data, exclude_unset=True)
vm = await dynamips_manager.create_node(
node_data.pop("name"),