def get_isis_topology(self, instance=None):
"""Get IS-IS topology table.
Returns:
list[dict]: List of dictionary with keys: vertex, type, metric, next_hop, interface, parent
"""
if instance:
try:
topology_output = instance.cli_send_command('vtysh -c "show isis topology"').stdout
except UICmdException as ex:
self.class_logger.error(ex)
pytest.fail('Failed to get IS-IS topology, node id {}.'.format(
instance.switch.id))
table = list(self.parse_isis_table_topology(topology_output.strip().splitlines()[4:]))
for record in table:
record["interface"] = instance.name_to_portid_map.get(record["interface"])
return table
else:
raise UIException("UI instance isn't specified.")
评论列表
文章目录