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

added location to coriant response

parent 1a05eb51
Branches
Tags
No related merge requests found
......@@ -412,9 +412,6 @@ def get_coriant_info(equipment_name, entity_string):
equipment_name, entity_string)
result = r.get(cache_key)
# this is just for development to save deleting the cache every time
# result = False
if result:
result = result.decode('utf-8')
else:
......@@ -431,7 +428,8 @@ def get_coriant_info(equipment_name, entity_string):
result = {
'equipment name': equipment_name,
'card id': m.group(1),
'port number': m.group(2)
'port number': m.group(2),
'locations': []
}
config = current_app.config['INVENTORY_PROVIDER_CONFIG']
......@@ -442,6 +440,18 @@ def get_coriant_info(equipment_name, entity_string):
if path:
result['path'] = path
result['locations'] += [{
'a': {
'equipment': path['a']['equipment name'],
'name': path['a']['pop']['name'],
'abbreviation': path['a']['pop']['abbreviation']
},
'b': {
'equipment': path['b']['equipment name'],
'name': path['b']['pop']['name'],
'abbreviation': path['b']['pop']['abbreviation']
}
}]
top_level_services = get_top_level_services(path['id'], r)
if top_level_services:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment