Skip to content
Snippets Groups Projects

Draft: Feature/pol1 744 fix speed issues

Closed Sam Roberts requested to merge feature/POL1-744-fix-speed-issues into develop
4 unresolved threads
1 file
+ 9
5
Compare changes
  • Side-by-side
  • Inline
@@ -701,13 +701,17 @@ def _load_interfaces(
def _add_speeds(config, interfaces):
all_netconf_interfaces = list(common.load_json_docs(config, 'classifier-cache:netconf-interfaces:all'))
netconf_interface_index = {f"{ifc['router']}---{ifc['name']}": ifc for ifc in all_netconf_interfaces[0]['value']}
all_netconf_interfaces = list(common.load_json_docs(config, 'netconf-interfaces:*'))
netconf_interface_index = {}
for netconf_interface_doc in all_netconf_interfaces:
nc_ifc = netconf_interface_doc['value']
if 'router' in nc_ifc and 'name' in nc_ifc:
netconf_interface_index[f"{nc_ifc['router']}---{nc_ifc['name']}"] = nc_ifc
for ifc in interfaces:
netconf_interface = netconf_interface_index.get(f"{ifc['router']}---{ifc['name']}", {})
if 'speed' in netconf_interface:
ifc['speed'] = netconf_interface['speed']
nc_ifc = netconf_interface_index.get(f"{ifc['router']}---{ifc['name']}", {})
if 'speed' in nc_ifc:
ifc['speed'] = nc_ifc['speed']
else:
ifc['speed'] = ''
yield ifc
Loading