Skip to content

Commit 9ad51c3

Browse files
committed
OSPF: skip interfaces without OSPF enabled
Fix a bug where systems with OSPF enabled on some, but not all, interfaces would cause the OSPF iterator to fail when accessing iface['area'], which was missing. This caused the ospf_status.py tool to return {}, resulting in empty OSPF data in sysrepo. Fixes #1169 Expected neighbors not shown in sysrepocfg Signed-off-by: Richard Alpe <richard@bit42.se>
1 parent 6272c9c commit 9ad51c3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

doc/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All notable changes to the project are documented in this file.
1212
### Fixes
1313
- Fix #1150: `show-legacy` wrapper permissions
1414
- Fix #1155: `show ospf` commands regression
15+
- Fix #1169: Expected neighbors not shown in sysrepocfg
1516

1617
[v25.08.0][] - 2025-09-01
1718
-------------------------

src/statd/python/ospf_status/ospf_status.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ def main():
4040
for ifname, iface in interfaces["interfaces"].items():
4141
iface["name"] = ifname
4242
iface["neighbors"] = []
43+
44+
# Skip interfaces that don't have OSPF enabled or area configured
45+
if not iface.get("ospfEnabled", False) or not iface.get("area"):
46+
continue
47+
4348
for area_id in ospf["areas"]:
4449
area_type=""
4550

0 commit comments

Comments
 (0)