Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
5dd7444a
Commit
5dd7444a
authored
2 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
specify lru_cache maxsize
parent
182172e9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inventory_provider/db/ims_data.py
+1
-1
1 addition, 1 deletion
inventory_provider/db/ims_data.py
inventory_provider/routes/msr.py
+2
-2
2 additions, 2 deletions
inventory_provider/routes/msr.py
inventory_provider/tasks/worker.py
+10
-2
10 additions, 2 deletions
inventory_provider/tasks/worker.py
with
13 additions
and
5 deletions
inventory_provider/db/ims_data.py
+
1
−
1
View file @
5dd7444a
...
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/routes/msr.py
+
2
−
2
View file @
5dd7444a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/tasks/worker.py
+
10
−
2
View file @
5dd7444a
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment