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

use primitive types instead of DefaultDict

parent a3650666
No related branches found
No related tags found
No related merge requests found
from typing import DefaultDict
from typing import Dict, List
from brian_dashboard_manager.templating.helpers import get_dashboard_data
def get_panel_data(interfaces):
result = DefaultDict(list)
result: Dict[str, List[Dict]] = {}
count = {}
......@@ -41,7 +41,7 @@ def get_panel_data(interfaces):
gws_measurement = 'gwsd_rates'
title = f'{nren} GWS Direct {isp} Interface {if_num} ({hostname})'
result[f'GWS Direct - {isp}'].append({
result.setdefault(f'GWS Direct - {isp}', []).append({
'isp': isp,
'nren': nren,
'measurement': gws_measurement,
......@@ -54,7 +54,7 @@ def get_panel_data(interfaces):
def get_gws_indirect_panel_data(interfaces):
result = DefaultDict(list)
result: Dict[str, List[Dict]] = {}
for interface in interfaces:
......@@ -65,7 +65,7 @@ def get_gws_indirect_panel_data(interfaces):
measurement = 'dscp32_rates'
panel_title = f'{hostname} - {{}} - {if_name} - #{service_name} IASGWS'
result[f'GWS Indirect - {customer}'].append({
result.setdefault(f'GWS Indirect - {customer}', []).append({
'measurement': measurement,
'title': panel_title,
'interface': if_name,
......
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