Skip to content
Snippets Groups Projects

add ipv6-only logic for panel creation for NRENs

Merged Sam Roberts requested to merge feature/POL1-648-ipv6-graphs into develop
1 file
+ 15
5
Compare changes
  • Side-by-side
  • Inline
@@ -231,11 +231,20 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards):
@@ -231,11 +231,20 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards):
# MDVPN type services don't have data in BRIAN
# MDVPN type services don't have data in BRIAN
continue
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({
dashboard['SERVICES'].append({
'measurement': measurement,
'measurement': measurement,
'title': title,
'title': title,
'scid': scid,
'scid': scid,
'sort': (sid[:2], name)
'sort': (sid[:2], name),
 
'has_v6': has_v6_interface
})
})
def _check_in_aggregate(router, interface):
def _check_in_aggregate(router, interface):
@@ -518,11 +527,12 @@ def default_interface_panel_generator(gridPos, ipv6_only=False):
@@ -518,11 +527,12 @@ def default_interface_panel_generator(gridPos, ipv6_only=False):
for panel in panels:
for panel in panels:
if ipv6_only:
if ipv6_only:
if panel.get('has_v6', False):
if panel.get('has_v6', False):
 
result.append(get_panel_fields({
 
**panel,
 
**next(gridPos)
 
}, 'IPv6', datasource))
 
else:
continue
continue
result.append(get_panel_fields({
**panel,
**next(gridPos)
}, 'IPv6', datasource))
else:
else:
result.append(get_panel_fields({
result.append(get_panel_fields({
**panel,
**panel,
Loading