From 0548ba673f8839c306cb721dbc994c56255c67a0 Mon Sep 17 00:00:00 2001 From: Ahmed Karic Date: Wed, 16 Oct 2024 09:34:39 +0200 Subject: [PATCH] statd: Add 'admin-status' to yanger The interface operational data was missing the 'admin-status' parameter, which indicates whether an interface is administratively enabled or disabled. To resolve this, the 'admin-status' was added to the yanger library, allowing 'statd' to retrieve and include this parameter in the operational data. --- src/statd/python/yanger/yanger.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/statd/python/yanger/yanger.py b/src/statd/python/yanger/yanger.py index ca27fd095..10e0d35ac 100755 --- a/src/statd/python/yanger/yanger.py +++ b/src/statd/python/yanger/yanger.py @@ -664,6 +664,15 @@ def add_ip_link(ifname, iface_in, iface_out): if 'link' in iface_in and not iface_is_dsa(iface_in): insert(iface_out, "infix-interfaces:vlan", "lower-layer-if", iface_in['link']) + if 'flags' in iface_in: + admin_xlate = { + "UP": "up", + "DOWN": "down" + } + + admin_status = admin_xlate.get("UP" if "UP" in iface_in['flags'] else "DOWN", "unknown") + iface_out['admin-status'] = admin_status + if 'operstate' in iface_in: xlate = { "DOWN": "down",