Update sorting function in BGP map for python 3

This commit is contained in:
Simon Marsh 2019-08-11 09:39:14 +01:00
parent 4b4723b958
commit fdec82cd90
Signed by: burble
GPG Key ID: 7B9FE8780CFB6593

2
lg.py
View File

@ -505,7 +505,7 @@ def show_bgpmap():
return edges[edge_tuple]
if "%s*" % label_without_star not in labels:
labels = [ kwargs["label"] ] + [ l for l in labels if not l.startswith(label_without_star) ]
labels = sorted(labels, cmp=lambda x,y: x.endswith("*") and -1 or 1)
labels = sorted(labels, key=lambda x: x.endswith("*") and -1 or 1)
label = escape("\r".join(labels))
e.set_label(label)