diff --git a/brian_dashboard_manager/templating/helpers.py b/brian_dashboard_manager/templating/helpers.py index dd71709b4c400d5d667b09843feb545c39131a45..6f98043061fdf490c393ba9da5d1663e45bfe08f 100644 --- a/brian_dashboard_manager/templating/helpers.py +++ b/brian_dashboard_manager/templating/helpers.py @@ -140,6 +140,7 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards): result = {} customers = defaultdict(list) + aggregate_interfaces = dict() for service in services: _customers = service.get('customers') @@ -187,6 +188,8 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards): router = router.replace('.geant.net', '') location = router.split('.')[1].upper() title = f'{location} - {customer} ({if_name}) | {name}' + + aggregate_interfaces[f'{router}:::{if_name}'] = True dashboard['AGGREGATES'].append({ 'measurement': measurement, 'alias': title, @@ -203,6 +206,9 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards): 'scid': scid }) + def _check_in_aggregate(router, interface): + return f'{router}:::{interface}' in aggregate_interfaces + for interface in interfaces: description = interface['description'].strip() @@ -225,7 +231,8 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards): 'PHYSICAL': [] }) - if port_type == 'access': + _covered_by_service = _check_in_aggregate(router, interface_name) + if port_type == 'access' and not _covered_by_service: dashboard['AGGREGATES'].append({ 'interface': interface_name, 'hostname': host,