From: Douglas Bagnall Date: Tue, 15 May 2018 02:40:36 +0000 (+1200) Subject: kcc graph verifier: use __doc__ description for error explanation X-Git-Tag: tevent-0.9.37~459 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e62cc29b472e7b33d88ece1797eb142e995cfa5b;p=thirdparty%2Fsamba.git kcc graph verifier: use __doc__ description for error explanation Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/kcc/graph.py b/python/samba/kcc/graph.py index 1e63f7c7629..d87530d40c3 100644 --- a/python/samba/kcc/graph.py +++ b/python/samba/kcc/graph.py @@ -188,7 +188,7 @@ def get_spanning_tree_edges(graph, my_site, label=None, verify=False, properties=('complete', 'connected')) if errors: DEBUG('spanning tree edge set %s FAILED' % edgeType) - for p, e in errors: + for p, e, doc in errors: DEBUG("%18s: %s" % (p, e)) raise KCCError("spanning tree failed") diff --git a/python/samba/kcc/graph_utils.py b/python/samba/kcc/graph_utils.py index e4fa821c798..291fd486424 100644 --- a/python/samba/kcc/graph_utils.py +++ b/python/samba/kcc/graph_utils.py @@ -294,7 +294,7 @@ def verify_graph(edges, vertices=None, directed=False, properties=()): try: f(edges, vertices, edge_vertices) except GraphError as e: - errors.append((p, e)) + errors.append((p, e, f.__doc__)) return errors @@ -319,13 +319,13 @@ def verify_and_dot(basename, edges, vertices=None, label=None, if errors: title = '%s %s' % (basename, label or '') debug(("%s%s%s FAILED:" % (MAGENTA, title, RED))) - for p, e in errors: + for p, e, doc in errors: debug(" %18s: %s%s%s" % (p, DARK_YELLOW, e, RED)) if fatal: raise GraphError("The '%s' graph lacks the following " "properties:\n%s" % - (title, '\n'.join('%s: %s' % x - for x in errors))) + (title, '\n'.join('%s: %s' % (p, e) + for p, e, doc in errors))) def list_verify_tests():