From 9c0f0c0594bcb6a9083c9b069ff4bb18c94bd9fe Mon Sep 17 00:00:00 2001 From: Robert Latta <robert.latta@geant.org> Date: Mon, 7 Dec 2020 17:01:50 +0000 Subject: [PATCH] corrected location lockup for fibertlink --- inventory_provider/routes/ims_classifier.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/inventory_provider/routes/ims_classifier.py b/inventory_provider/routes/ims_classifier.py index 91ca946b..2e5edb3e 100644 --- a/inventory_provider/routes/ims_classifier.py +++ b/inventory_provider/routes/ims_classifier.py @@ -127,7 +127,7 @@ def get_ims_interface(interface: str) -> str: return interface.upper() -def related_interfaces(hostname:str, interface: str) -> Iterator[str]: +def related_interfaces(hostname: str, interface: str) -> Iterator[str]: r = common.get_current_redis() prefix = f'netconf-interfaces:{hostname}:' for k in r.keys(prefix + interface + '.*'): @@ -608,14 +608,14 @@ def get_fiberlink_trap_metadata(ne_name_str: str, object_name_str: str) \ x[0]['df_route_id'] == x[1]['df_route_id']] if matches: match = matches[0] - locations_a = _location_from_equipment(equipment_a, r) - locations_b = _location_from_equipment(equipment_b, r) - if locations_a: - loc_a = locations_a[0]['a'] + location_a = _location_from_equipment(equipment_a, r) + location_b = _location_from_equipment(equipment_b, r) + if location_a: + loc_a = location_a else: loc_a = _LOCATION(equipment_a, '', '') - if locations_b: - loc_b = locations_b[0]['a'] + if location_b: + loc_b = location_b else: loc_b = _LOCATION(equipment_b, '', '') -- GitLab