X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FNodePath.py;h=f41103046f3c04153b14d7800fff46fc365baa8f;hp=dfcee4d7201c673efa5276c597c5644a51de1d3e;hb=4c6fe5602edcbd9857a846e5b13a21d5c671a2c8;hpb=c8790d06d412b1daf303f6da9d8d11d97d053697 diff --git a/resources/libraries/python/NodePath.py b/resources/libraries/python/NodePath.py index dfcee4d720..f41103046f 100644 --- a/resources/libraries/python/NodePath.py +++ b/resources/libraries/python/NodePath.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. +# Copyright (c) 2018 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: @@ -93,15 +93,15 @@ class NodePath(object): def compute_path(self, always_same_link=True): """Compute path for added nodes. + .. note:: First add at least two nodes to the topology. + :param always_same_link: If True use always same link between two nodes - in path. If False use different link (if available) between two - nodes if one link was used before. + in path. If False use different link (if available) + between two nodes if one link was used before. :type always_same_link: bool - - .. note:: First add at least two nodes to the topology. + :raises RuntimeError: If not enough nodes for path. """ nodes = self._nodes - nodes_filer = self._nodes_filter if len(nodes) < 2: raise RuntimeError('Not enough nodes to compute path') @@ -144,7 +144,7 @@ class NodePath(object): def next_interface(self): """Path interface iterator. - :return: Interface and node or None if not next interface. + :returns: Interface and node or None if not next interface. :rtype: tuple (str, dict) .. note:: Call compute_path before. @@ -157,7 +157,7 @@ class NodePath(object): def first_interface(self): """Return first interface on the path. - :return: Interface and node. + :returns: Interface and node. :rtype: tuple (str, dict) .. note:: Call compute_path before. @@ -169,7 +169,7 @@ class NodePath(object): def last_interface(self): """Return last interface on the path. - :return: Interface and node. + :returns: Interface and node. :rtype: tuple (str, dict) .. note:: Call compute_path before. @@ -181,7 +181,7 @@ class NodePath(object): def first_ingress_interface(self): """Return first ingress interface on the path. - :return: Interface and node. + :returns: Interface and node. :rtype: tuple (str, dict) .. note:: Call compute_path before. @@ -193,7 +193,7 @@ class NodePath(object): def last_egress_interface(self): """Return last egress interface on the path. - :return: Interface and node. + :returns: Interface and node. :rtype: tuple (str, dict) .. note:: Call compute_path before.