Skip to content
Snippets Groups Projects
Commit 664432b7 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device - gNMI OpenConfig Driver:

- Corrected MTU logic
parent eba2fe40
No related branches found
No related tags found
1 merge request!298Resolve "Merge Hackfest 5 in `develop` and related code fixes"
......@@ -41,14 +41,14 @@ class InterfaceHandler(_Handler):
vlan_id = get_int (resource_value, 'vlan_id', ) # 127
address_ip = get_str (resource_value, 'address_ip' ) # 172.16.0.1
address_prefix = get_int (resource_value, 'address_prefix') # 24
#mtu = get_int (resource_value, 'mtu', 1450) # 1500
mtu = get_int (resource_value, 'mtu', ) # 1500
yang_ifs : libyang.DContainer = yang_handler.get_data_path('/openconfig-interfaces:interfaces')
yang_if_path = 'interface[name="{:s}"]'.format(if_name)
yang_if : libyang.DContainer = yang_ifs.create_path(yang_if_path)
yang_if.create_path('config/name', if_name )
if enabled is not None: yang_if.create_path('config/enabled', enabled)
#if mtu is not None: yang_if.create_path('config/mtu', mtu)
if mtu is not None: yang_if.create_path('config/mtu', mtu)
yang_sifs : libyang.DContainer = yang_if.create_path('subinterfaces')
yang_sif_path = 'subinterface[index="{:d}"]'.format(sif_index)
......@@ -69,7 +69,6 @@ class InterfaceHandler(_Handler):
yang_ipv4_addr : libyang.DContainer = yang_ipv4_addrs.create_path(yang_ipv4_addr_path)
yang_ipv4_addr.create_path('config/ip', address_ip)
yang_ipv4_addr.create_path('config/prefix-length', address_prefix)
#if mtu is not None: yang_ipv4_addr.create_path('config/mtu', mtu)
str_path = '/interfaces/interface[name={:s}]'.format(if_name)
str_data = yang_if.print_mem('json')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment