1
0
Fork 0
mirror of https://github.com/sileht/bird-lg.git synced 2024-11-22 06:54:43 +01:00

Merge pull request #27 from oszafraniec/master

'NoneType' object has no attribute 'split'
This commit is contained in:
Mehdi ABAAKOUK 2017-10-26 15:36:58 +02:00 committed by GitHub
commit 92be35bdc8

5
lg.py
View file

@ -437,7 +437,10 @@ def show_bgpmap():
e = edges[edge_tuple]
label_without_star = kwargs["label"].replace("*", "")
labels = e.get_label().split("\r")
if e.get_label() is not None:
labels = e.get_label().split("\r")
else:
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)