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

corrected portrelate query

parent f1596bef
No related branches found
No related tags found
No related merge requests found
...@@ -232,8 +232,11 @@ class IMS(object): ...@@ -232,8 +232,11 @@ class IMS(object):
if NO_FILTERED_RESULTS_MESSAGE in response_.text.lower(): if NO_FILTERED_RESULTS_MESSAGE in response_.text.lower():
return False return False
try:
r = response_.json() r = response_.json()
except Exception as e:
logger.debug(f"unexpected response: {response_.text}")
raise e
if r and 'HasErrors' in r and r['HasErrors']: if r and 'HasErrors' in r and r['HasErrors']:
for e in r['Errors']: for e in r['Errors']:
if 'Guid expired' in e['ErrorMessage']: if 'Guid expired' in e['ErrorMessage']:
......
...@@ -35,8 +35,6 @@ def get_service_types(ds: IMS): ...@@ -35,8 +35,6 @@ def get_service_types(ds: IMS):
yield d['selection'] yield d['selection']
# http://test-inventory-provider-ims.geant.org:8080/classifier/infinera-lambda-info/VEN-OLA1/1-A-3-L1/wibble
def get_fibre_info(ds: IMS): def get_fibre_info(ds: IMS):
# get all the wdm ots circuits where each node is in a different location # get all the wdm ots circuits where each node is in a different location
...@@ -177,10 +175,8 @@ def get_port_id_services(ds: IMS): ...@@ -177,10 +175,8 @@ def get_port_id_services(ds: IMS):
ports = [circuit['portaid'], circuit['portbid']] ports = [circuit['portaid'], circuit['portbid']]
yield from _populate_end_info(cd, ports) yield from _populate_end_info(cd, ports)
ignore_status_str = ''.join([ ignore_status_str = ''.join([
f'inventoryStatusId != {s} | ' for s in STATUSES_TO_IGNORE f'circuit.inventoryStatusId != {s} | ' for s in STATUSES_TO_IGNORE
]) ])
for portrelate in chain( for portrelate in chain(
ds.get_filtered_entities( ds.get_filtered_entities(
......
...@@ -496,7 +496,7 @@ def update_fibre_spans(self, use_current=False): ...@@ -496,7 +496,7 @@ def update_fibre_spans(self, use_current=False):
@app.task( @app.task(
base=InventoryTask, bind=True, name='update_interfaces_to_services_ims') base=InventoryTask, bind=True, name='update_interfaces_to_services')
@log_task_entry_and_exit @log_task_entry_and_exit
def update_interfaces_to_services(self, use_current=False): def update_interfaces_to_services(self, use_current=False):
port_id_services = defaultdict(list) port_id_services = defaultdict(list)
......
...@@ -5,7 +5,7 @@ from inventory_provider.db.ims import InventoryStatus ...@@ -5,7 +5,7 @@ from inventory_provider.db.ims import InventoryStatus
from inventory_provider.db.ims_data import lookup_lg_routers, \ from inventory_provider.db.ims_data import lookup_lg_routers, \
otrs_get_customer_company_rows, \ otrs_get_customer_company_rows, \
otrs_get_customer_users_rows, get_node_locations, IMS_OPSDB_STATUS_MAP, \ otrs_get_customer_users_rows, get_node_locations, IMS_OPSDB_STATUS_MAP, \
get_fibre_info, get_port_id_services, get_port_details, \ get_port_id_services, get_port_details, \
get_circuit_hierarchy get_circuit_hierarchy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment