Skip to content
Snippets Groups Projects
Commit 32d3cfe7 authored by Sam Roberts's avatar Sam Roberts
Browse files

Merge branch 'feature/POL1-855-fix-EAP-issues' into 'develop'

Feature/pol1 855 fix eap issues

See merge request !45
parents f363d592 2d11f654
No related branches found
No related tags found
1 merge request!45Feature/pol1 855 fix eap issues
...@@ -490,6 +490,8 @@ def _get_dashboards(interface, region=None): ...@@ -490,6 +490,8 @@ def _get_dashboards(interface, region=None):
ifc_name = interface.get('name', '') ifc_name = interface.get('name', '')
description = interface.get('description', '').strip() description = interface.get('description', '').strip()
is_phy_upstream = re.match(r'PHY UPSTREAM\s', description)
if 'SRV_L3VPN' in description and 'COPERNICUS' in description: if 'SRV_L3VPN' in description and 'COPERNICUS' in description:
yield BRIAN_DASHBOARDS.COPERNICUS yield BRIAN_DASHBOARDS.COPERNICUS
if re.match(r'SRV_CLS\s', description): if re.match(r'SRV_CLS\s', description):
...@@ -538,20 +540,18 @@ def _get_dashboards(interface, region=None): ...@@ -538,20 +540,18 @@ def _get_dashboards(interface, region=None):
if router == 'rt1.mar.fr.geant.net' \ if router == 'rt1.mar.fr.geant.net' \
and re.match(r'^ae12\.\d+$', ifc_name): and re.match(r'^ae12\.\d+$', ifc_name):
yield BRIAN_DASHBOARDS.IC1 yield BRIAN_DASHBOARDS.IC1
if re.match(r'PHY UPSTREAM\s', description): if is_phy_upstream:
yield BRIAN_DASHBOARDS.GWS_PHY_UPSTREAM yield BRIAN_DASHBOARDS.GWS_PHY_UPSTREAM
regex = r'(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER\s' regex = r'(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER\s'
if re.match(regex, description) and region is None: if re.match(regex, description) and region is None:
yield BRIAN_DASHBOARDS.NREN yield BRIAN_DASHBOARDS.NREN
if "GA-" in description and "ANA-" in description: if "GA-" in description and "ANA-" in description:
yield BRIAN_DASHBOARDS.ANA yield BRIAN_DASHBOARDS.ANA
if region == 'EAP': if region == 'EAP' and not is_phy_upstream:
yield BRIAN_DASHBOARDS.EAP yield BRIAN_DASHBOARDS.EAP
def _get_dashboard_data(ifc, customers, regions=None): def _get_dashboard_data(ifc, customers):
if regions is None:
regions = []
def _get_interface_type(description): def _get_interface_type(description):
if re.match(r'^PHY', description): if re.match(r'^PHY', description):
...@@ -609,15 +609,6 @@ def _get_dashboard_data(ifc, customers, regions=None): ...@@ -609,15 +609,6 @@ def _get_dashboard_data(ifc, customers, regions=None):
if not names: if not names:
return ifc return ifc
# add region-based dashboard names
region_names = []
for name in names:
if name in regions:
region = regions[name]
if region == 'EAP':
region_names.append(BRIAN_DASHBOARDS.EAP.name)
names.extend(region_names)
# to maintain compatability with current brian dashboard manager we will # to maintain compatability with current brian dashboard manager we will
# continue to return dashboard_info with the first customer name. We will # continue to return dashboard_info with the first customer name. We will
# also return dashboards_info (note the plural of dashboards) with up to # also return dashboards_info (note the plural of dashboards) with up to
...@@ -921,7 +912,7 @@ def load_interfaces_to_poll(config, hostname=None, no_lab=False, use_next_redis= ...@@ -921,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['dashboards'] = sorted([d.name for d in dashboards])
ifc = _get_dashboard_data( 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']) port_type = _get_port_type(ifc['description'])
ifc['port_type'] = port_type ifc['port_type'] = port_type
yield ifc yield ifc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment