Give node types their own identifiers and make the network show method use them

This commit is contained in:
Marek Wolan
2024-10-04 09:20:07 +01:00
parent 5fde945fac
commit b5b7fc6a8d
11 changed files with 31 additions and 28 deletions

View File

@@ -179,9 +179,8 @@ class Network(SimComponent):
table.set_style(MARKDOWN)
table.align = "l"
table.title = "Nodes"
for node_type, nodes in nodes_type_map.items():
for node in nodes:
table.add_row([node.hostname, node_type, node.operating_state.name])
for node in self.nodes.values():
table.add_row((node.hostname, type(node)._identifier, node.operating_state.name))
print(table)
if ip_addresses: