From 2d11f654db6fb7f612d84bec7abe7bcbe7f0c588 Mon Sep 17 00:00:00 2001 From: Sam Roberts <sam.roberts@geant.org> Date: Fri, 18 Oct 2024 11:07:02 +0100 Subject: [PATCH] filter out PHY UPSTREAM interfaces from EAP dashboards --- inventory_provider/routes/poller.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inventory_provider/routes/poller.py b/inventory_provider/routes/poller.py index b112320..7ff32eb 100644 --- a/inventory_provider/routes/poller.py +++ b/inventory_provider/routes/poller.py @@ -490,6 +490,8 @@ def _get_dashboards(interface, region=None): ifc_name = interface.get('name', '') description = interface.get('description', '').strip() + is_phy_upstream = re.match(r'PHY UPSTREAM\s', description) + if 'SRV_L3VPN' in description and 'COPERNICUS' in description: yield BRIAN_DASHBOARDS.COPERNICUS if re.match(r'SRV_CLS\s', description): @@ -538,20 +540,18 @@ def _get_dashboards(interface, region=None): if router == 'rt1.mar.fr.geant.net' \ and re.match(r'^ae12\.\d+$', ifc_name): yield BRIAN_DASHBOARDS.IC1 - if re.match(r'PHY UPSTREAM\s', description): + if is_phy_upstream: yield BRIAN_DASHBOARDS.GWS_PHY_UPSTREAM regex = r'(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER\s' if re.match(regex, description) and region is None: yield BRIAN_DASHBOARDS.NREN if "GA-" in description and "ANA-" in description: yield BRIAN_DASHBOARDS.ANA - if region == 'EAP': + if region == 'EAP' and not is_phy_upstream: yield BRIAN_DASHBOARDS.EAP -def _get_dashboard_data(ifc, customers, regions=None): - if regions is None: - regions = [] +def _get_dashboard_data(ifc, customers): def _get_interface_type(description): if re.match(r'^PHY', description): @@ -912,7 +912,7 @@ def load_interfaces_to_poll(config, hostname=None, no_lab=False, use_next_redis= ifc['dashboards'] = sorted([d.name for d in dashboards]) ifc = _get_dashboard_data( - ifc, ifc_services_and_customers.get('customers', []), nren_regions) + ifc, ifc_services_and_customers.get('customers', [])) port_type = _get_port_type(ifc['description']) ifc['port_type'] = port_type yield ifc -- GitLab