Better bird parsing

This commit is contained in:
Sebastian Lohff 2015-08-13 12:30:47 +02:00
parent 15bfd12b5c
commit 2fea65579b
1 changed files with 2 additions and 2 deletions

View File

@ -154,8 +154,8 @@ def _birdMakeProtocols(info):
"online": data[n][2] == "Established", "online": data[n][2] == "Established",
"neighbor_address": data[n+1][2], "neighbor_address": data[n+1][2],
"neighbor_as": int(data[n+2][2]), "neighbor_as": int(data[n+2][2]),
"neighbor_id": data[n+3][2] if data[n+3][0:2] == ["Neighbor", "ID:"] 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 data[n+3][0:2] == ["Last", "error:"] 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: if not found: