From 4cba634890cbbcaf8891a75a1c7c28e322e336ab Mon Sep 17 00:00:00 2001 From: Bjarke Madsen <bjarke.madsen@geant.org> Date: Mon, 21 Nov 2022 11:35:13 +0100 Subject: [PATCH] Add all 'access' interfaces to panel aggregates --- brian_dashboard_manager/templating/helpers.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/brian_dashboard_manager/templating/helpers.py b/brian_dashboard_manager/templating/helpers.py index d026cb6..a55b095 100644 --- a/brian_dashboard_manager/templating/helpers.py +++ b/brian_dashboard_manager/templating/helpers.py @@ -207,6 +207,7 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards): description = interface['description'].strip() interface_name = interface['name'] host = interface['router'] + port_type = interface.get('port_type', 'unknown').lower() router = host.replace('.geant.net', '') location = host.split('.')[1].upper() @@ -223,6 +224,15 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards): 'PHYSICAL': [] }) + if port_type == 'access': + logger.info(f'{f"{location} - {dashboard_name} ({interface_name})"} #### {description}') + dashboard['AGGREGATES'].append({ + 'interface': interface_name, + 'hostname': host, + 'alias': + f"{location} - {dashboard_name} ({interface_name})" + }) + if info['interface_type'] == 'AGGREGATE': # link aggregates are also shown # under the physical dropdown -- GitLab