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

don't return logical-system with interface

parent 73e3cbb3
No related branches found
No related tags found
No related merge requests found
......@@ -73,11 +73,8 @@ def _load_snmp_indexes(hostname=None):
for doc in common.load_json_docs(
config_params=current_app.config['INVENTORY_PROVIDER_CONFIG'],
key_pattern=key_pattern):
router = doc['key'][len('snmp-interfaces:'):]
interfaces = dict(
[(e['name'], e['index']) for e in doc['value']])
result[router] = interfaces
result[router] = {e['name']: e for e in doc['value']}
return result
......@@ -147,6 +144,7 @@ def _load_interfaces(hostname):
for ifc in juniper.list_interfaces(doc['value']):
if not ifc['description']:
continue
yield {
'router': router,
'name': ifc['name'],
......@@ -170,7 +168,11 @@ def _load_poller_interfaces(hostname=None):
if not router_snmp or ifc['name'] not in router_snmp:
# there's no way to poll this interface
continue
ifc['snmp-index'] = router_snmp[ifc['name']]
ifc['snmp-index'] = router_snmp[ifc['name']]['index']
# TODO: uncomment this when it won't break poller-admin-service
# not urgent ... it looks empirically like all logical-system
# interfaces are repeated for both communities
# ifc['snmp-community'] = router_snmp[ifc['name']]['community']
router_bundle = bundles.get(ifc['router'], None)
if router_bundle:
......
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