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): ...@@ -73,11 +73,8 @@ def _load_snmp_indexes(hostname=None):
for doc in common.load_json_docs( for doc in common.load_json_docs(
config_params=current_app.config['INVENTORY_PROVIDER_CONFIG'], config_params=current_app.config['INVENTORY_PROVIDER_CONFIG'],
key_pattern=key_pattern): key_pattern=key_pattern):
router = doc['key'][len('snmp-interfaces:'):] router = doc['key'][len('snmp-interfaces:'):]
interfaces = dict( result[router] = {e['name']: e for e in doc['value']}
[(e['name'], e['index']) for e in doc['value']])
result[router] = interfaces
return result return result
...@@ -147,6 +144,7 @@ def _load_interfaces(hostname): ...@@ -147,6 +144,7 @@ def _load_interfaces(hostname):
for ifc in juniper.list_interfaces(doc['value']): for ifc in juniper.list_interfaces(doc['value']):
if not ifc['description']: if not ifc['description']:
continue continue
yield { yield {
'router': router, 'router': router,
'name': ifc['name'], 'name': ifc['name'],
...@@ -170,7 +168,11 @@ def _load_poller_interfaces(hostname=None): ...@@ -170,7 +168,11 @@ def _load_poller_interfaces(hostname=None):
if not router_snmp or ifc['name'] not in router_snmp: if not router_snmp or ifc['name'] not in router_snmp:
# there's no way to poll this interface # there's no way to poll this interface
continue 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) router_bundle = bundles.get(ifc['router'], None)
if router_bundle: 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