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
Branches
Tags
No related merge requests found
...@@ -62,11 +62,11 @@ def get_top_level_services(circuit_id, r): ...@@ -62,11 +62,11 @@ def get_top_level_services(circuit_id, r):
for c in results: for c in results:
temp_parents = \ temp_parents = \
get_top_level_services(c['parent_circuit_id'], r) get_top_level_services(c['parent_circuit_id'], r)
if not temp_parents and \ if not temp_parents:
c['parent_circuit_type'].lower() == 'service':
tls.append( tls.append(
{'name': c['parent_circuit'], {'name': c['parent_circuit'],
'status': c['parent_circuit_status']}) 'status': c['parent_circuit_status'],
'circuit_type': c['parent_circuit_type']})
tls.extend(temp_parents) tls.extend(temp_parents)
return tls return tls
...@@ -118,9 +118,12 @@ def get_juniper_link_info(source_equipment, interface): ...@@ -118,9 +118,12 @@ def get_juniper_link_info(source_equipment, interface):
for s in json.loads(rs.decode('utf-8')): for s in json.loads(rs.decode('utf-8')):
top_level_services.extend( top_level_services.extend(
get_top_level_services(s['id'], r)) get_top_level_services(s['id'], r))
if s['circuit_type'].lower() == 'service': all_rs.append(
all_rs.append( {
{'name': s['name'], 'status': s['status']}) 'name': s['name'],
'status': s['status'],
'circuit_type': s['circuit_type']
})
return all_rs return all_rs
related_services = _related_services() related_services = _related_services()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment