mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 13:03:02 +02:00
yanger: Tolerate missing DR/BDR IDs in OSPF neighbor info
With the FRR upgrade to 9.1.2, OSPF sometimes reports neighbors without reporting the routerDesignatedId and routerDesignatedBackupId attributes. Ensure that these attributes are available before trying to copy them to the output.
This commit is contained in:
committed by
Mattias Walström
parent
de47caec38
commit
fabb28b5df
@@ -492,10 +492,12 @@ def add_ospf(control_protocols):
|
||||
neighbor = {}
|
||||
neighbor["neighbor-router-id"] = neigh["neighborIp"]
|
||||
neighbor["address"] = neigh["ifaceAddress"]
|
||||
neighbor["dr-router-id"] = neigh["routerDesignatedId"]
|
||||
neighbor["bdr-router-id"] = neigh["routerDesignatedBackupId"]
|
||||
neighbor["dead-timer"] = neigh["routerDeadIntervalTimerDueMsec"]
|
||||
neighbor["state"] = frr_to_ietf_neighbor_state(neigh["nbrState"])
|
||||
if neigh.get("routerDesignatedId"):
|
||||
neighbor["dr-router-id"] = neigh["routerDesignatedId"]
|
||||
if neigh.get("routerDesignatedBackupId"):
|
||||
neighbor["bdr-router-id"] = neigh["routerDesignatedBackupId"]
|
||||
neighbors.append(neighbor)
|
||||
|
||||
interface["ietf-ospf:neighbors"] = {}
|
||||
|
||||
Reference in New Issue
Block a user