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

fixed incorrect key name

parent c2260731
No related branches found
No related tags found
No related merge requests found
......@@ -701,9 +701,12 @@ def _build_subnet_db(update_callback=lambda s: None):
subnets = {}
# scan with bigger batches, to mitigate network latency effects
for k in r.scan_iter('netconf-interfaces-hosts:*', count=1000):
host_interfaces = r.get(k.decode('utf-8')).decode('utf-8')
k = k.decode('utf-8')
hostname = k[len('netconf-interfaces-hosts:'):]
host_interfaces = r.get(k).decode('utf-8')
host_interfaces = json.loads(host_interfaces)
for ifc in host_interfaces:
ifc['router'] = hostname
entry = subnets.setdefault(ifc['interface address'], [])
entry.append(ifc)
......
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