yanger: skip internal interfaces

In "14128047e18d statd: remove nl code and improve speed" the handling
of all interfaces where moved from statd to Yanger. This means statd no
longer tracks interfaces using Netlink, but instead relies on Yanger
to recognise and list all interfaces in the system. In the midst of
this change the ignoring of "internal" interfaces where lost.

In this commit we reintroduce this logic in Yanger and add a test case
that ensures internal interfaces isn't listed.

Fixes: 14128047e1 statd: remove nl code and improve speed

Signed-off-by: Richard Alpe <richard@bit42.se>
This commit is contained in:
Richard Alpe
2024-10-01 14:28:31 +02:00
parent 240a292725
commit 707e7d1a29
5 changed files with 148 additions and 0 deletions
+4
View File
@@ -899,6 +899,10 @@ def _add_interface(ifname, ip_link_data, ip_addr_data, yang_ifaces):
if not ip_link_data or not ip_addr_data:
return
# Skip internal interfaces.
if 'group' in ip_link_data and ip_link_data['group'] == "internal":
return
yang_ifaces.append(get_iface_data(ifname, ip_link_data, ip_addr_data))
def add_interface(ifname, yang_ifaces):