ui_dcrp_shell.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:taf 作者: taf3 项目源码 文件源码
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.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号