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

rejigged ciruit_type assignment

parent 7fd1ddd6
No related branches found
No related tags found
No related merge requests found
......@@ -31,19 +31,19 @@ def get_interface_services(ds: IMS):
# include the relevant carrier circuits
# service types come from the 'product' information
service_types = {
'geant lambda',
'geant plus',
'geant ip',
'l3-vpn',
'ip peering - non r&e (public)',
'ip peering - non r&e (private)',
'ip peering - r&e',
'ip trunk',
'ip access',
'geant cloud peering',
'geant open port',
'geant open cross connect',
'pop lan link',
'GEANT LAMBDA',
'GEANT PLUS',
'GEANT IP',
'L3-VPN',
'IP PEERING - NON R&E (PUBLIC)',
'IP PEERING - NON R&E (PRIVATE)',
'IP PEERING - R&E',
'IP TRUNK',
'IP ACCESS',
'GEANT CLOUD PEERING',
'GEANT OPEN PORT',
'GEANT OPEN CROSS CONNECT',
'POP LAN LINK',
'SERVER LINK',
'GEANT - GBS',
}
......@@ -61,17 +61,22 @@ def get_interface_services(ds: IMS):
def _get_circuits():
for st in service_types:
yield from ds.get_filtered_entities(
'Circuit',
f'product.name == "{st}"',
circuit_nav_props,
step_count=1000)
for c in ds.get_filtered_entities(
'Circuit',
f'product.name == "{st}"',
circuit_nav_props,
step_count=1000):
c['circuit_type'] = 'service'
yield c
for spd in speeds:
yield from ds.get_filtered_entities(
'Circuit',
f'speed.name == "{spd}"',
circuit_nav_props,
step_count=1000)
for c in ds.get_filtered_entities(
'Circuit',
f'speed.name == "{spd}"',
circuit_nav_props,
step_count=1000):
c['circuit_type'] = 'circuit'
yield c
circuits = _get_circuits()
......@@ -112,8 +117,7 @@ def get_interface_services(ds: IMS):
'name': circuit['name'],
'status': IMS_OPSDB_STATUS_MAP.get(
InventoryStatus(circuit['inventorystatusid']), 'unknown'),
'circuit_type': 'service'
if circuit['product']['name'] in service_types else 'circuit',
'circuit_type': circuit['circuit_type'],
'service_type': circuit['product']['name'],
'project': circuit['product']['name']
}
......
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