diff --git a/inventory_provider/routes/classifier.py b/inventory_provider/routes/classifier.py index 143960335200928d8b9e14edb14f7a2f0eea65a5..751321a140630aca4dacbdf9c2fd372783b0c045 100644 --- a/inventory_provider/routes/classifier.py +++ b/inventory_provider/routes/classifier.py @@ -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()