Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Reformat python libraries.
[csit.git]
/
resources
/
libraries
/
python
/
NodePath.py
diff --git
a/resources/libraries/python/NodePath.py
b/resources/libraries/python/NodePath.py
index
51808c3
..
bbc6d31
100644
(file)
--- a/
resources/libraries/python/NodePath.py
+++ b/
resources/libraries/python/NodePath.py
@@
-13,7
+13,7
@@
"""Path utilities library for nodes in the topology."""
"""Path utilities library for nodes in the topology."""
-from topology import Topology
+from
resources.libraries.python.
topology import Topology
class NodePath(object):
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
"""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.
: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']))
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(
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:
'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:
.. note:: Call compute_path before.
"""
if not self._path_iter:
- return
(None, None)
+ return
None, None
else:
return self._path_iter.pop()
else:
return self._path_iter.pop()