diff --git a/bin/routerparsers.py b/bin/routerparsers.py index f03b3f9..99ccbc8 100644 --- a/bin/routerparsers.py +++ b/bin/routerparsers.py @@ -292,7 +292,7 @@ def _quaggaFindRoutes(raw): # BGP table version is 0, local router ID is 10.50.0.1 # *> 10.3.14.0/27 10.75.0.22 0 65002 65112 i cmdre = re.compile(r"^([^\s#]+#) show ip bgp$") - routere = re.compile(r"^(?P.)(?P.)(?P.)(?P[0-9./]+)?\s+(?P[0-9./]+)[\s0-9i]+$") + routere = re.compile(r"^(?P.)(?P.)(?P.)(?P[0-9./]+)?\s+(?P[0-9./]+)[\s0-9i?]+$") # find output output = [] @@ -336,7 +336,9 @@ def _quaggaFindRoutes(raw): # "parse" path (everything after 61 chars, but no i) path = filter(lambda _x: _x not in ('', 'i'), line[61:].split(" ")) - route = {"prefix": d["network"], "nexthop": d["nexthop"], "path": path, "iBGP": d["origin"] == "i"} - routes.append(route) + # currently skip incomplete routes + if '?' not in path: + route = {"prefix": d["network"], "nexthop": d["nexthop"], "path": path, "iBGP": d["origin"] == "i"} + routes.append(route) return routes