Skip to content
Snippets Groups Projects
Commit 141dc950 authored by Erik Reid's avatar Erik Reid
Browse files

Merge branch 'feature/POL1-483-gws-upstream-names' into 'develop'

Add parsing of dashboard name for GWS PHY UPSTREAM

See merge request live-projects/dashboardv3/inventory-provider!4
parents d974040b 632cba0e
No related branches found
No related tags found
No related merge requests found
...@@ -486,6 +486,11 @@ def _get_dashboard_data(ifc): ...@@ -486,6 +486,11 @@ def _get_dashboard_data(ifc):
name = description.split('|') name = description.split('|')
name = name[1].strip() name = name[1].strip()
name = name.replace('( ', '(') name = name.replace('( ', '(')
elif BRIAN_DASHBOARDS.GWS_PHY_UPSTREAM.name in dashboards:
name = description.split(' ')[2].strip().upper()
host = ifc['router']
location = host.split('.')[1].upper()
name = f'{name} - {location}'
else: else:
name = description.split(' ')[2].upper() name = description.split(' ')[2].upper()
......
...@@ -290,8 +290,9 @@ def test_interface_dashboard_mapping(description, expected_dashboards): ...@@ -290,8 +290,9 @@ def test_interface_dashboard_mapping(description, expected_dashboards):
}, {'name': 'FCCN', 'interface_type': 'LOGICAL'}), }, {'name': 'FCCN', 'interface_type': 'LOGICAL'}),
({ ({
'description': 'PHY UPSTREAM TELIA SRF9940473 | Telia ID: IC-326863', 'description': 'PHY UPSTREAM TELIA SRF9940473 | Telia ID: IC-326863',
'router': 'mx1.bud.hu.geant.net',
'dashboards': ['GWS_PHY_UPSTREAM'] 'dashboards': ['GWS_PHY_UPSTREAM']
}, {'name': 'TELIA', 'interface_type': 'PHYSICAL'}), }, {'name': 'TELIA - BUD', 'interface_type': 'PHYSICAL'}),
({ ({
'description': 'SRV_IAS UPSTREAM COGENT #COGENT_GWS_VIE | ASN174', 'description': 'SRV_IAS UPSTREAM COGENT #COGENT_GWS_VIE | ASN174',
'dashboards': ['IAS_UPSTREAM'] 'dashboards': ['IAS_UPSTREAM']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment