mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 21:13:00 +02:00
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 Fixes #700
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user