summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2016-11-02 16:49:49 +1300
committerAndrew Bartlett <abartlet@samba.org>2016-12-01 05:54:24 +0100
commit1a5445ca4e729389a7b5c226cf1d9b73429013a1 (patch)
tree9fe2e14139ba52eb5d2fe9554fa09deeb9f3b9b4 /python
parent6057c2522c85e23899dc26be4537683e388d49f0 (diff)
downloadsamba-1a5445ca4e729389a7b5c226cf1d9b73429013a1.tar.gz
KCC: avoid infinite recursion when edgelist contains self
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'python')
-rw-r--r--python/samba/kcc/kcc_utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/samba/kcc/kcc_utils.py b/python/samba/kcc/kcc_utils.py
index 1d4b9d61f18..aefe1aa1a85 100644
--- a/python/samba/kcc/kcc_utils.py
+++ b/python/samba/kcc/kcc_utils.py
@@ -1791,7 +1791,9 @@ class GraphNode(object):
text = text + "\n\tmax_edges=%d" % self.max_edges
for i, edge in enumerate(self.edge_from):
- text = text + "\n\tedge_from[%d]=%s" % (i, edge)
+ if isinstance(edge, str):
+ text += "\n\tedge_from[%d]=%s" % (i, edge)
+
return text
def add_edge_from(self, from_dsa_dnstr):
@@ -1799,7 +1801,7 @@ class GraphNode(object):
:param from_dsa_dnstr: the dsa that the edge emanates from
"""
- assert from_dsa_dnstr is not None
+ assert isinstance(from_dsa_dnstr, str)
# No edges from myself to myself
if from_dsa_dnstr == self.dsa_dnstr: