edit output yaml

This commit is contained in:
2026-03-16 02:05:31 +03:00
parent 35cf7d4dd7
commit 94e635e9f3
3 changed files with 12 additions and 8 deletions
+1
View File
@@ -1,4 +1,5 @@
data/
plan.md
# Byte-compiled / optimized / DLL files
__pycache__/
+4 -4
View File
@@ -1,10 +1,10 @@
Name,Role,Adapter,Interface,Master Interface,Network,VLAN,Network IP,Mask,Device IP,Default Gateway
PC1,Host,Adapter1,eth1,vlan7,A,,,,,
PC1,Host,,vlan7,,7,10.10.10.0,/24,10.10.10.7,0.0.0.0,
PC1,Host,,vlan7,,,7,10.10.10.0,/24,10.10.10.7,0.0.0.0
PC2,Host,Adapter1,eth1,vlan9,B,,,,,
PC2,Host,,vlan9,,9,10.10.10.0,/24,10.10.10.9,0.0.0.0,
com,Switch,Adapter1,eth2,vlan7,A,7,,,,
com,Switch,Adapter2,eth3,vlan9,B,9,,,,
PC2,Host,,vlan9,,,9,10.10.10.0,/24,10.10.10.9,0.0.0.0
com,Switch,Adapter1,eth1,vlan7,A,7,,,,
com,Switch,Adapter2,eth2,vlan9,B,9,,,,
com,Switch,,vlan7,bridge,,,,,,
com,Switch,,vlan9,bridge,,,,,,
com,Switch,,bridge,,,,,,,
1 Name Role Adapter Interface Master Interface Network VLAN Network IP Mask Device IP Default Gateway
2 PC1 Host Adapter1 eth1 vlan7 A
3 PC1 Host vlan7 7 10.10.10.0 7 /24 10.10.10.0 10.10.10.7 /24 0.0.0.0 10.10.10.7 0.0.0.0
4 PC2 Host Adapter1 eth1 vlan9 B
5 PC2 Host vlan9 9 10.10.10.0 9 /24 10.10.10.0 10.10.10.9 /24 0.0.0.0 10.10.10.9 0.0.0.0
6 com Switch Adapter1 eth2 eth1 vlan7 A 7
7 com Switch Adapter2 eth3 eth2 vlan9 B 9
8 com Switch vlan7 bridge
9 com Switch vlan9 bridge
10 com Switch bridge
+7 -4
View File
@@ -21,11 +21,14 @@ def make_yaml(topology: Topology, output_path: Path) -> None:
if len(interfaces_with_device) >= 2:
data["networks"].append(
# {
# network.name: [
# f"{iface.device.name}.{iface.name}"
# for iface in interfaces_with_device
# ]
# }
{
network.name: [
f"{iface.device.name}.{iface.name}"
for iface in interfaces_with_device
]
"name": network.name,
}
)