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

use new snmp-interfaces cache format

parent 8c1d79e9
No related branches found
No related tags found
No related merge requests found
......@@ -32,17 +32,7 @@ def poller_interface_oids(hostname):
status=404,
mimetype='text/html')
def _ifc_name(ifc):
if 'v4InterfaceName' in ifc:
return ifc['v4InterfaceName']
if 'v6InterfaceName' in ifc:
return ifc['v6InterfaceName']
assert False, 'sanity failure: no interface name found'
snmp_indexes = dict([
(_ifc_name(ifc), int(ifc['index'])) for ifc in
json.loads(snmp_data_string.decode('utf-8'))
])
snmp_indexes = json.loads(snmp_data_string.decode('utf-8'))
interfaces = list(juniper.list_interfaces(
etree.XML(netconf_string.decode('utf-8'))))
......
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