aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/topology.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2018-04-13 19:45:33 +0200
committerPeter Mikus <pmikus@cisco.com>2018-04-25 08:47:31 +0000
commit4c6fe5602edcbd9857a846e5b13a21d5c671a2c8 (patch)
treeb360a3e65094f9fe542451a747132ff24663b115 /resources/libraries/python/topology.py
parent59e06f5e3143bf093bdb6b53c0186b050668e3d4 (diff)
Fix warnings reported by gen_doc.sh
+ Docstring warnings fixed. + Multiline param descriptions indented by 4 spaces. - Except the PacketVerifier.py one - I have tried several quote-like blocks, nothing works. - Rst warnings not fixed. - How can I fix them? They refer to temporarily created files. + Other improvements: + Python lines no longer than 80 characters. + :return: -> :returns: + Notes before params. + :raises + closing colon after exception class. + Description is a sentence. + Present tense in conditional sentences. + Bumped copyright year in edited files. Change-Id: I462c194eeecb666dc146e26858486a07c990be9b Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/topology.py')
-rw-r--r--resources/libraries/python/topology.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/resources/libraries/python/topology.py b/resources/libraries/python/topology.py
index 13dbdddb07..2f4fd023ba 100644
--- a/resources/libraries/python/topology.py
+++ b/resources/libraries/python/topology.py
@@ -71,6 +71,7 @@ class Topology(object):
"Active topology" contains initially data from the topology file and can be
extended with additional data from the DUTs like internal interface indexes
or names. Additional data which can be filled to the active topology are
+
- additional internal representation (index, name, ...)
- operational data (dynamic ports)
@@ -349,11 +350,11 @@ class Topology(object):
:param node: The node topology directory.
:param link_names: List of names of the link that a interface is
- connected to.
+ connected to.
:type node: dict
:type link_names: list
:returns: Dictionary of interface names that are connected to the given
- links.
+ links.
:rtype: dict
"""
retval = {}
@@ -465,8 +466,7 @@ class Topology(object):
:param node: Node in topology.
:param interface: Name, sw_if_index, link name or key of an interface
- on the node.
- Valid formats are: sw_if_index, key, name.
+ on the node.
:type node: dict
:type interface: str or int
@@ -505,16 +505,14 @@ class Topology(object):
:param node: Node in topology.
:param interface: Name, sw_if_index, link name or key of an interface
- on the node.
+ on the node.
:param wanted_format: Format of return value wanted.
- Valid options are: sw_if_index, key, name.
+ Valid options are: sw_if_index, key, name.
:type node: dict
:type interface: str or int
:type wanted_format: str
-
:returns: Interface name, interface key or sw_if_index.
:rtype: str or int
-
:raises TypeError, ValueError: If provided with invalid arguments.
:raises RuntimeError: If the interface does not exist in topology.
"""
@@ -620,7 +618,7 @@ class Topology(object):
on local network.
:param nodes_info: Dictionary containing information on all nodes
- in topology.
+ in topology.
:param node: Node that contains specified interface.
:param iface_key: Interface key from topology file.
:type nodes_info: dict
@@ -786,7 +784,7 @@ class Topology(object):
:type node2: dict
:returns: Name of link connecting the two nodes together.
:rtype: str
- :raises: RuntimeError
+ :raises RuntimeError: If no links are found.
"""
connecting_links = self.get_active_connecting_links(node1, node2)
if len(connecting_links) == 0: