X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FNodePath.py;fp=resources%2Flibraries%2Fpython%2FNodePath.py;h=bbc6d31811bb70e1d21ed2d52124f6116c4f0d24;hp=51808c3edf7bc04f7b517d5c90832d86f87fea44;hb=8c12ff59f1a5e750151f5eb0e806dcc80e91c3c2;hpb=4a7f950c10ca9bcf86e5ccbc3d49a3d7e3cb9809 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()