Skip to content
Snippets Groups Projects
Commit ed62d254 authored by Robert Latta's avatar Robert Latta
Browse files

added path to coriant classification

parent ad6a82f9
No related branches found
No related tags found
No related merge requests found
......@@ -855,7 +855,8 @@ def get_coriant_info(equipment_name: str, entity_string: str) -> Response:
interface_name,
r
))
for s in result.get('services', []):
services = result.get('services', [])
for s in services:
s.pop('card_id', None)
s.pop('port', None)
s.pop('logical_unit', None)
......@@ -863,6 +864,41 @@ def get_coriant_info(equipment_name: str, entity_string: str) -> Response:
s.pop('other_end_port', None)
s.pop('other_end_logical_unit', None)
p = {
'category': '',
'circuit_type': '',
'service_type': '',
'peering_type': '',
'status': '',
'name': '',
'a': {
'equipment name': '',
'card id': '',
'port number': '',
'pop': {
'name': '',
'city': '',
'country': '',
'abbreviation': '',
'longitude': 0,
'latitude': 0,
}
}
}
if services:
s = services[0]
p['status'] = s['status']
p['name'] = s['name']
p['a']['equipment name'] = ims_source_equipment
p['a']['card id'] = card_id
p['a']['port number'] = port
p['a']['pop']['name'] = s.get('pop_name', '')
p['a']['pop']['city'] = s.get('pop_name', '')
p['a']['pop']['abbreviation'] = s.get('pop_abbreviation', '')
p['b'] = p['a']
result['path'] = p
result['locations'] = _remove_duplicates_from_list(result['locations'])
result = json.dumps(result)
# cache this data for the next call
......
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