Skip to content

Commit

Permalink
Merge pull request #721 from kernelkit/add-admin-status-to-yanger
Browse files Browse the repository at this point in the history
Statd: Add 'admin-status' to Interface Operational Data
  • Loading branch information
axkar authored Oct 16, 2024
2 parents 7de94b9 + 3f0b85a commit 1583071
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/statd/python/yanger/yanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", "testing")
iface_out['admin-status'] = admin_status

if 'operstate' in iface_in:
xlate = {
"DOWN": "down",
Expand Down

0 comments on commit 1583071

Please sign in to comment.