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

Added the non-services (e.g. L2 circuits) back into the services and...

Added the non-services (e.g. L2 circuits) back into the services and related-services sections; added circuit_type to related-services
parent 5c1a3dcc
No related branches found
No related tags found
No related merge requests found
......@@ -62,11 +62,11 @@ def get_top_level_services(circuit_id, r):
for c in results:
temp_parents = \
get_top_level_services(c['parent_circuit_id'], r)
if not temp_parents and \
c['parent_circuit_type'].lower() == 'service':
if not temp_parents:
tls.append(
{'name': c['parent_circuit'],
'status': c['parent_circuit_status']})
'status': c['parent_circuit_status'],
'circuit_type': c['parent_circuit_type']})
tls.extend(temp_parents)
return tls
......@@ -118,9 +118,12 @@ def get_juniper_link_info(source_equipment, interface):
for s in json.loads(rs.decode('utf-8')):
top_level_services.extend(
get_top_level_services(s['id'], r))
if s['circuit_type'].lower() == 'service':
all_rs.append(
{'name': s['name'], 'status': s['status']})
all_rs.append(
{
'name': s['name'],
'status': s['status'],
'circuit_type': s['circuit_type']
})
return all_rs
related_services = _related_services()
......
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