X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FNodePath.py;h=dd685069147f2ecd6d448e5a21f06f4c9335edbe;hp=d1f974aafee51e227ea0b8a6d28368ca3a427fc5;hb=b6606e7625e308a66bdfb9d5a9c065b58e429a99;hpb=ec467277744783015a2da6713298b35d13d92e6f diff --git a/resources/libraries/python/NodePath.py b/resources/libraries/python/NodePath.py index d1f974aafe..dd68506914 100644 --- a/resources/libraries/python/NodePath.py +++ b/resources/libraries/python/NodePath.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -217,7 +217,8 @@ class NodePath: raise RuntimeError(u"No path for topology") return self._path[-2] - def compute_circular_topology(self, nodes, filter_list=None, nic_pfs=1, + def compute_circular_topology( + self, nodes, filter_list=None, nic_pfs=1, always_same_link=False, topo_has_tg=True, topo_has_dut=True): """Return computed circular path. @@ -250,12 +251,18 @@ class NodePath: for _ in range(0, nic_pfs // 2): if topo_has_tg: - self.append_node(nodes[u"TG"]) + if topo_has_dut: + self.append_node(nodes[u"TG"]) + else: + self.append_node(nodes[u"TG"], filter_list=filter_list) if topo_has_dut: for dut in duts: self.append_node(nodes[dut], filter_list=filter_list) if topo_has_tg: - self.append_node(nodes[u"TG"]) + if topo_has_dut: + self.append_node(nodes[u"TG"]) + else: + self.append_node(nodes[u"TG"], filter_list=filter_list) self.compute_path(always_same_link, topo_has_dut) n_idx = 0 # node index