Skip to content
Snippets Groups Projects
Commit 5dd7444a authored by Erik Reid's avatar Erik Reid
Browse files

specify lru_cache maxsize

parent 182172e9
Branches
Tags
No related merge requests found
......@@ -170,7 +170,7 @@ def get_port_id_services(ds: IMS):
c['circuit_type'] = _get_circuit_type(c)
yield c
circuits = _get_circuits()
circuits = list(_get_circuits())
# order of preference
# internalports (first and last sequencenumbers)
......
......@@ -883,7 +883,7 @@ def get_peering_services():
# TODO: @functools.cache is only available in py3.9
@functools.lru_cache
@functools.lru_cache(maxsize=None)
def _load_all_interfaces():
"""
loads all ip interfaces in the network and returns as a dict
......@@ -911,7 +911,7 @@ def _load_all_interfaces():
# TODO: @functools.cache is only available in py3.9
@functools.lru_cache
@functools.lru_cache(maxsize=None)
def _load_redundant_access_peers():
"""
load all peers that should be considered
......
......@@ -722,11 +722,17 @@ def ims_task(self, use_current=False):
def extract_ims_data():
c = InventoryTask.config["ims"]
return _extract_ims_data(
ims_api_url=c['api'],
ims_username=c['username'],
ims_password=c['password'])
def _extract_ims_data(ims_api_url, ims_username, ims_password):
def _ds() -> IMS:
return IMS(c['api'], c['username'], c['password'])
return IMS(ims_api_url, ims_username, ims_password)
locations = {}
lg_routers = []
......@@ -1062,6 +1068,8 @@ def transform_ims_data(data):
if sid_info not in sid_services[sid]:
sid_services[sid].append(sid_info)
if k.startswith('MX1.LON.UK:XE-1/0/0'):
print('here')
interface_services[k].extend(circuits)
return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment