diff options
author | Matej Klotton <mklotton@cisco.com> | 2016-03-24 16:14:20 +0100 |
---|---|---|
committer | Stefan Kobza <skobza@cisco.com> | 2016-04-22 15:06:08 +0000 |
commit | 8c12ff59f1a5e750151f5eb0e806dcc80e91c3c2 (patch) | |
tree | d42ae972c451e4d0714f000ce9262a64ca06848c /resources/libraries/python/NodePath.py | |
parent | 4a7f950c10ca9bcf86e5ccbc3d49a3d7e3cb9809 (diff) |
Reformat python libraries.
PEP8 reformat
fix typos
docstrings reformat
Change-Id: Ic48ba4e06490630808b8e2ab1ab0b046ec7eeed7
Signed-off-by: Matej Klotton <mklotton@cisco.com>
Diffstat (limited to 'resources/libraries/python/NodePath.py')
-rw-r--r-- | resources/libraries/python/NodePath.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/resources/libraries/python/NodePath.py b/resources/libraries/python/NodePath.py index 51808c3edf..bbc6d31811 100644 --- a/resources/libraries/python/NodePath.py +++ b/resources/libraries/python/NodePath.py @@ -13,7 +13,7 @@ """Path utilities library for nodes in the topology.""" -from topology import Topology +from resources.libraries.python.topology import Topology class NodePath(object): @@ -89,8 +89,8 @@ class NodePath(object): """Compute path for added nodes. :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. @@ -108,16 +108,13 @@ class NodePath(object): raise RuntimeError('No link between {0} and {1}'.format( node1['host'], node2['host'])) - link = None - l_set = set() - if always_same_link: l_set = set(links).intersection(self._links) else: l_set = set(links).difference(self._links) if not l_set: raise RuntimeError( - 'No free link between {0} and {1}, all links already ' \ + 'No free link between {0} and {1}, all links already ' 'used'.format(node1['host'], node2['host'])) if not l_set: @@ -143,7 +140,7 @@ class NodePath(object): .. note:: Call compute_path before. """ if not self._path_iter: - return (None, None) + return None, None else: return self._path_iter.pop() |