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
f4e1ef2b
Commit
f4e1ef2b
authored
10 months ago
by
geant-release-service
Browse files
Options
Downloads
Plain Diff
Finished release 0.122.
parents
fc756dff
4293fc04
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
Changelog.md
+3
-0
3 additions, 0 deletions
Changelog.md
inventory_provider/routes/msr.py
+7
-10
7 additions, 10 deletions
inventory_provider/routes/msr.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
11 additions
and
11 deletions
Changelog.md
+
3
−
0
View file @
f4e1ef2b
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/routes/msr.py
+
7
−
10
View file @
f4e1ef2b
...
...
@@ -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
:
d
ict
):
def
_ip_endpoint_extractor
(
all_interfaces
:
Dict
,
endpoint_details
:
D
ict
):
"""
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
)
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
f4e1ef2b
...
...
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup
(
name
=
'
inventory-provider
'
,
version
=
"
0.12
1
"
,
version
=
"
0.12
2
"
,
author
=
'
GEANT
'
,
author_email
=
'
swd@geant.org
'
,
description
=
'
Dashboard inventory provider
'
,
...
...
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