Skip to content
Snippets Groups Projects
Commit fbf4f6e8 authored by Saket Agrahari's avatar Saket Agrahari
Browse files

Merge branch 'feature/DBOARD3-676' into 'develop'

[DBOARD3-676]: Adding circuit types to the list of mic data

See merge request !27
parents f5925760 0a29fc85
No related branches found
No related tags found
1 merge request!27[DBOARD3-676]: Adding circuit types to the list of mic data
......@@ -1383,6 +1383,19 @@ def populate_mic_cache(interface_services, r):
'third_party_id': rs.get('third_party_id', '')
}
def _get_formatted_interface_service(_is):
if _is['status'] == 'operational':
return {
'id': _is['id'],
'sid': _is.get('sid', ''),
'status': _is['status'],
'name': _is['name'],
'service_type': 'circuit_type',
'contacts': _is['contacts'],
'planned_work_contacts': _is['planned_work_contacts'],
'third_party_id': _is.get('third_party_id', '')
}
for services in interface_services.values():
if services:
current_interface_services = []
......@@ -1393,6 +1406,11 @@ def populate_mic_cache(interface_services, r):
if rs['id'] not in seen_ids:
current_interface_services.append(rs)
seen_ids.add(rs['id'])
if (str(d.get('id')) + 'circuit') not in seen_ids:
_is = _get_formatted_interface_service(d)
if _is:
current_interface_services.append(_is)
seen_ids.add(str(d.get('id')) + 'circuit')
if current_interface_services:
site = f'{services[0]["pop_name"]} ' \
......
......@@ -549,6 +549,9 @@ def test_persist_ims_data(mocker, data_config, mocked_redis):
"status": "operational",
"pop_name": "LOC A",
"pop_abbreviation": "aaa",
"contacts": [],
"planned_work_contacts": [],
"third_party_id": "I2-S13168 - RTSW.NEWY32AOA.NET.INTERNET2.EDU",
"related-services": [
{
"id": "sub_circuit_1",
......
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