From d2b40fab022f073e3e18ea147d5a1694580cdccc Mon Sep 17 00:00:00 2001 From: Bjarke Madsen <bjarke@nordu.net> Date: Mon, 27 Feb 2023 14:06:43 +0100 Subject: [PATCH] don't make dashboards for NRENs with no panels --- brian_dashboard_manager/templating/helpers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/brian_dashboard_manager/templating/helpers.py b/brian_dashboard_manager/templating/helpers.py index 6f98043..1b2fd0c 100644 --- a/brian_dashboard_manager/templating/helpers.py +++ b/brian_dashboard_manager/templating/helpers.py @@ -199,6 +199,7 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards): if 'MDVPN' in service['service_type']: # MDVPN type services don't have data in BRIAN continue + title = f'{name} ({sid})' dashboard['SERVICES'].append({ 'measurement': measurement, @@ -256,6 +257,12 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards): }) result[dashboard_name] = dashboard + + for customer in list(result.keys()): + lengths = [len(val) for val in result[customer].values()] + if sum(lengths) == 0: + # no services/interfaces, so remove it + del result[customer] return result -- GitLab