Browse Source

Better bird parsing

master
Sebastian Lohff 7 years ago
parent
commit
2fea65579b
  1. 4
      bin/routerparsers.py

4
bin/routerparsers.py

@ -154,8 +154,8 @@ def _birdMakeProtocols(info): @@ -154,8 +154,8 @@ def _birdMakeProtocols(info):
"online": data[n][2] == "Established",
"neighbor_address": data[n+1][2],
"neighbor_as": int(data[n+2][2]),
"neighbor_id": data[n+3][2] if data[n+3][0:2] == ["Neighbor", "ID:"] else None,
"last_error": " ".join(data[n+3][2:]) if data[n+3][0:2] == ["Last", "error:"] else None,
"neighbor_id": data[n+3][2] if len(data) > n+3 and data[n+3][0:2] == ["Neighbor", "ID:"] else None,
"last_error": " ".join(data[n+3][2:]) if len(data) > n+3 and data[n+3][0:2] == ["Last", "error:"] else None,
}
if not found:

Loading…
Cancel
Save