Skip to content
Snippets Groups Projects
Commit 64217bc4 authored by Erik Reid's avatar Erik Reid
Browse files

ignore subinterfaces of inactive interfaces

parent 4f2831db
No related branches found
No related tags found
No related merge requests found
......@@ -207,19 +207,23 @@ def list_interfaces(netconf_config):
return ifc
def _units(base_name, node):
for u in node.xpath('./unit'):
if u.get('inactive', None) == 'inactive':
def _inactive(interface_node):
return interface_node.get('inactive', None) == 'inactive'
def _units(base_name, interface_node):
for u in interface_node.xpath('./unit'):
if _inactive(u):
continue
unit_info = _ifc_info(u)
unit_info['name'] = "%s.%s" % (base_name, unit_info['name'])
yield unit_info
for i in netconf_config.xpath('//configuration/interfaces/interface'):
if _inactive(i):
continue
info = _ifc_info(i)
yield info
for u in _units(info['name'], i):
yield u
yield from _units(info['name'], i)
for i in netconf_config.xpath(
'//configuration/logical-systems/interfaces/interface'):
......
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