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

eap stuff still not quite working right

parent a387c1f8
No related branches found
No related tags found
1 merge request!13Feature/pol1 430 EAP NRENs
......@@ -57,6 +57,11 @@ DASHBOARDS = {
'folder_name': 'NREN Access',
'interfaces': []
},
'EAP': {
'tag': ['eap'],
'folder_name': 'EAP',
'interfaces': []
},
'RE_PEER': {
'tag': 'RE_PEER',
'folder_name': 'RE Peer',
......@@ -228,16 +233,21 @@ def provision_folder(token_request, folder_name, dash, services,
is_nren_legacy = folder_name == "NREN Access LEGACY"
is_nren = folder_name == "NREN Access"
is_eap = folder_name == "EAP" # POL1-430
is_re_peer = folder_name == "RE Peer"
is_service = 'service_type' in dash
has_aggregate_panels = is_nren or is_nren_legacy or is_re_peer or is_service
has_aggregate_panels = is_nren or is_nren_legacy or is_eap or is_re_peer or is_service
if is_nren_legacy:
data = get_nren_interface_data_old(interfaces)
dash_data = get_nren_dashboard_data(data, ds_name, tag)
elif is_nren:
data = get_nren_interface_data(
services, interfaces, excluded_dashboards)
data = {k: v for k, v in get_nren_interface_data(
services, interfaces, excluded_dashboards).items() if 'EAP' not in v['TAGS']}
dash_data = get_nren_dashboard_data(data, ds_name, tag)
elif is_eap:
data = {k: v for k, v in get_nren_interface_data(
services, interfaces, excluded_dashboards).items() if 'EAP' in v['TAGS']}
dash_data = get_nren_dashboard_data(data, ds_name, tag)
elif is_re_peer:
data = get_re_peer_interface_data(interfaces)
......
......@@ -251,7 +251,8 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards):
dashboard = result.setdefault(customer, {
'AGGREGATES': [],
'SERVICES': [],
'PHYSICAL': []
'PHYSICAL': [],
'TAGS': set()
})
for service in services:
......@@ -331,7 +332,8 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards):
dashboard = result.get(dashboard_name, {
'AGGREGATES': [],
'SERVICES': [],
'PHYSICAL': []
'PHYSICAL': [],
'TAGS': set()
})
_covered_by_service = _check_in_aggregate(router, interface_name)
......@@ -357,6 +359,8 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards):
'hostname': host,
'interface': interface_name
})
for tag in interface.get('dashboards', []):
dashboard['TAGS'].add(tag)
result[dashboard_name] = dashboard
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment