From 50b1f1387e71ff27a29373833d656c2e7273a923 Mon Sep 17 00:00:00 2001 From: Alarig Le Lay Date: Fri, 12 Apr 2019 19:34:07 +0200 Subject: [PATCH] Applying patch from @fduraffourg that fixes #9 --- lg.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lg.py b/lg.py index 6a9f4e7..40caa95 100644 --- a/lg.py +++ b/lg.py @@ -575,7 +575,11 @@ def build_as_tree_from_raw_bird_ouput(host, proto, text): net_dest = expr2.group(1).strip() if line.startswith("BGP.as_path:"): - path.extend(line.replace("BGP.as_path:", "").strip().split(" ")) + ASes = line.replace("BGP.as_path:", "").strip().split(" ") + if path: + path.extend(ASes) + else: + path = ASes if path: path.append(net_dest)