Merge pull request #146 from thebracket/integration-fixes

Use client ID as circuit ID when building ShapedDevices.csv
This commit is contained in:
Robert Chacón 2022-11-01 08:44:55 -06:00 committed by GitHub
commit 5e8bd0af7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -330,13 +330,12 @@ class NetworkGraph:
from ispConfig import bandwidthOverheadFactor
# Builds ShapedDevices.csv from the network tree.
circuits = []
nextId = 0
for (i, node) in enumerate(self.nodes):
if node.type == NodeType.client:
parent = self.nodes[node.parentIndex].displayName
if parent == "Shaper Root": parent = ""
circuit = {
"id": nextId,
"id": node.id,
"name": node.address,
"parent": parent,
"download": node.downloadMbps,
@ -358,7 +357,6 @@ class NetworkGraph:
circuit["devices"].append(device)
if len(circuit["devices"]) > 0:
circuits.append(circuit)
nextId += 1
with open('ShapedDevices.csv', 'w', newline='') as csvfile:
wr = csv.writer(csvfile, quoting=csv.QUOTE_ALL)