Skip to content
Snippets Groups Projects
Commit f4e1ef2b authored by geant-release-service's avatar geant-release-service
Browse files

Finished release 0.122.

parents fc756dff 4293fc04
Branches
Tags
No related merge requests found
......@@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.
## [0.122] - 2024-06-20
- Remove use of functools caching for /msr/services endpoint and reuse fresh data instead
## [0.121] - 2024-06-17
- DBOARD3-956: Include all Related Services contact info in TTS notification
......
......@@ -944,8 +944,6 @@ def get_peering_services():
return Response(response, mimetype="application/json")
# TODO: @functools.cache is only available in py3.9
@functools.lru_cache(maxsize=None)
def _load_all_interfaces():
"""
loads all ip interfaces in the network and returns as a dict
......@@ -972,8 +970,6 @@ def _load_all_interfaces():
return result
# TODO: @functools.cache is only available in py3.9
@functools.lru_cache(maxsize=None)
def _load_redundant_access_peers():
"""
load all peers that should be considered
......@@ -997,7 +993,7 @@ def _load_redundant_access_peers():
return result
def _ip_endpoint_extractor(endpoint_details: dict):
def _ip_endpoint_extractor(all_interfaces: Dict, endpoint_details: Dict):
"""
special-purpose method used only by _endpoint_extractor
......@@ -1019,7 +1015,6 @@ def _ip_endpoint_extractor(endpoint_details: dict):
'interface': interface,
}
all_interfaces = _load_all_interfaces()
# sanity: should have already been checked
assert hostname in all_interfaces
......@@ -1039,7 +1034,7 @@ def _ip_endpoint_extractor(endpoint_details: dict):
return ip_endpoint
def _endpoint_extractor(endpoint_details: Dict):
def _endpoint_extractor(all_interfaces: Dict, endpoint_details: Dict):
"""
special-purpose method used only by get_system_correlation_services
......@@ -1057,9 +1052,9 @@ def _endpoint_extractor(endpoint_details: Dict):
return
potential_hostname = ims_equipment_to_hostname(
endpoint_details['equipment'])
all_routers = _load_all_interfaces().keys()
all_routers = all_interfaces.keys()
if potential_hostname in all_routers:
return _ip_endpoint_extractor(endpoint_details)
return _ip_endpoint_extractor(all_interfaces, endpoint_details)
else:
return {
'equipment': endpoint_details['equipment'],
......@@ -1107,6 +1102,8 @@ def get_system_correlation_services():
response = _ignore_cache_or_retrieve(request, cache_key, r)
if not response:
all_interfaces = _load_all_interfaces()
sid_services = json.loads(r.get('ims:sid_services').decode('utf-8'))
response = []
......@@ -1123,7 +1120,7 @@ def get_system_correlation_services():
service_info['service_type'] = d['service_type']
service_info['customer'] = d['customer']
endpoint = _endpoint_extractor(d)
endpoint = _endpoint_extractor(all_interfaces, d)
if endpoint:
service_info['endpoints'].append(endpoint)
......
......@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='inventory-provider',
version="0.121",
version="0.122",
author='GEANT',
author_email='swd@geant.org',
description='Dashboard inventory provider',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment