Skip to content
Snippets Groups Projects
Commit 20f0231d authored by Sam Roberts's avatar Sam Roberts
Browse files

only show services that have any ipv6 data to show

parent 634987de
No related branches found
No related tags found
1 merge request!2add ipv6-only logic for panel creation for NRENs
......@@ -231,11 +231,20 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards):
# MDVPN type services don't have data in BRIAN
continue
has_v6_interface = False
for interface in _interfaces:
if 'addresses' in interface:
for address in interface['addresses']:
if address.find(':') > 0:
has_v6_interface = True
break
dashboard['SERVICES'].append({
'measurement': measurement,
'title': title,
'scid': scid,
'sort': (sid[:2], name)
'sort': (sid[:2], name),
'has_v6': has_v6_interface
})
def _check_in_aggregate(router, interface):
......@@ -518,11 +527,12 @@ def default_interface_panel_generator(gridPos, ipv6_only=False):
for panel in panels:
if ipv6_only:
if panel.get('has_v6', False):
result.append(get_panel_fields({
**panel,
**next(gridPos)
}, 'IPv6', datasource))
else:
continue
result.append(get_panel_fields({
**panel,
**next(gridPos)
}, 'IPv6', datasource))
else:
result.append(get_panel_fields({
**panel,
......
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