From 0b81e4630669b556dd7df5fd2863c1634c029d0a Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Mon, 29 Sep 2025 10:27:00 +0200 Subject: [PATCH] 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 --- doc/ChangeLog.md | 1 + src/statd/python/ospf_status/ospf_status.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index cea8c75a..0d3a71d0 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -29,6 +29,7 @@ All notable changes to the project are documented in this file. - Fix #1155: `show ospf` commands regression - Fix #1150: `show-legacy` wrapper permissions - Fix #1161: error in log during boot about unsupported command +- Fix #1169: Expected neighbors not shown in sysrepocfg - Fixes for unicode translation in log and pager outputs as well as `syslogd` [BPI-R3]: https://wiki.banana-pi.org/Banana_Pi_BPI-R3 diff --git a/src/statd/python/ospf_status/ospf_status.py b/src/statd/python/ospf_status/ospf_status.py index 09bcff84..ecc89217 100755 --- a/src/statd/python/ospf_status/ospf_status.py +++ b/src/statd/python/ospf_status/ospf_status.py @@ -40,6 +40,11 @@ def main(): for ifname, iface in interfaces["interfaces"].items(): iface["name"] = ifname iface["neighbors"] = [] + + # Skip interfaces that don't have OSPF enabled or area configured + if not iface.get("ospfEnabled", False) or not iface.get("area"): + continue + for area_id in ospf["areas"]: area_type=""