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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
8c0a6057
Commit
8c0a6057
authored
Oct 25, 2023
by
Sam Roberts
Browse files
Options
Downloads
Patches
Plain Diff
connect everything back together in prep for IMS task splitting
parent
691fd01b
No related branches found
No related tags found
1 merge request
!22
Feature/pol1 744 fix speed issues
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
inventory_provider/routes/poller.py
+4
-5
4 additions, 5 deletions
inventory_provider/routes/poller.py
inventory_provider/tasks/worker.py
+10
-12
10 additions, 12 deletions
inventory_provider/tasks/worker.py
with
14 additions
and
17 deletions
inventory_provider/routes/poller.py
+
4
−
5
View file @
8c0a6057
...
@@ -703,15 +703,14 @@ def _load_interfaces(
...
@@ -703,15 +703,14 @@ def _load_interfaces(
def
_add_speeds
(
config
,
interfaces
):
def
_add_speeds
(
config
,
interfaces
):
netconf_interfaces_all
=
list
(
common
.
load_json_docs
(
config
,
'
netconf-interfaces:all
'
))
netconf_interfaces_all
=
list
(
common
.
load_json_docs
(
config
,
'
netconf-interfaces:all
'
))
try
:
try
:
all_netconf_interfaces
=
netconf_interfaces_all
[
0
]
all_netconf_interfaces
=
netconf_interfaces_all
[
0
]
[
'
value
'
]
except
IndexError
:
except
IndexError
:
all_netconf_interfaces
=
[]
all_netconf_interfaces
=
[]
netconf_interface_index
=
{}
netconf_interface_index
=
{}
for
netconf_interface_doc
in
all_netconf_interfaces
:
for
nc_ifc
in
all_netconf_interfaces
:
nc_ifc
=
netconf_interface_doc
[
'
value
'
]
if
'
hostname
'
in
nc_ifc
and
'
name
'
in
nc_ifc
:
if
'
router
'
in
nc_ifc
and
'
name
'
in
nc_ifc
:
netconf_interface_index
[
f
"
{
nc_ifc
[
'
hostname
'
]
}
---
{
nc_ifc
[
'
name
'
]
}
"
]
=
nc_ifc
netconf_interface_index
[
f
"
{
nc_ifc
[
'
router
'
]
}
---
{
nc_ifc
[
'
name
'
]
}
"
]
=
nc_ifc
for
ifc
in
interfaces
:
for
ifc
in
interfaces
:
nc_ifc
=
netconf_interface_index
.
get
(
f
"
{
ifc
[
'
router
'
]
}
---
{
ifc
[
'
name
'
]
}
"
,
{})
nc_ifc
=
netconf_interface_index
.
get
(
f
"
{
ifc
[
'
router
'
]
}
---
{
ifc
[
'
name
'
]
}
"
,
{})
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/tasks/worker.py
+
10
−
12
View file @
8c0a6057
...
@@ -451,7 +451,6 @@ def update_entry_point(self):
...
@@ -451,7 +451,6 @@ def update_entry_point(self):
chord
(
chord
(
(
(
ims_task
.
s
().
on_error
(
task_error_handler
.
s
()),
ims_task
.
s
().
on_error
(
task_error_handler
.
s
()),
chord
((
chord
(
chord
(
(
reload_router_config_chorded
.
s
(
r
)
for
r
in
routers
),
(
reload_router_config_chorded
.
s
(
r
)
for
r
in
routers
),
empty_task
.
si
(
'
router tasks complete
'
)
empty_task
.
si
(
'
router tasks complete
'
)
...
@@ -460,8 +459,7 @@ def update_entry_point(self):
...
@@ -460,8 +459,7 @@ def update_entry_point(self):
(
reload_lab_router_config_chorded
.
s
(
r
)
(
reload_lab_router_config_chorded
.
s
(
r
)
for
r
in
lab_routers
),
for
r
in
lab_routers
),
empty_task
.
si
(
'
lab router tasks complete
'
)
empty_task
.
si
(
'
lab router tasks complete
'
)
))
)
),
),
),
final_task
.
si
().
on_error
(
task_error_handler
.
s
())
final_task
.
si
().
on_error
(
task_error_handler
.
s
())
)()
)()
...
@@ -1464,8 +1462,8 @@ def collate_netconf_interfaces_all_cache(warning_callback=lambda s: None):
...
@@ -1464,8 +1462,8 @@ def collate_netconf_interfaces_all_cache(warning_callback=lambda s: None):
key
=
k
.
decode
(
'
utf-8
'
)
key
=
k
.
decode
(
'
utf-8
'
)
doc_str
=
r
.
get
(
key
).
decode
(
'
utf-8
'
)
doc_str
=
r
.
get
(
key
).
decode
(
'
utf-8
'
)
doc
=
json
.
loads
(
doc_str
)
doc
=
json
.
loads
(
doc_str
)
doc
[
'
hostname
'
]
=
k
.
split
(
'
:
'
)[
1
]
# get hostname part of key
doc
[
'
hostname
'
]
=
k
ey
.
split
(
'
:
'
)[
1
]
# get hostname part of key
yield
json
.
loads
(
doc_str
)
yield
doc
netconf_all_key
=
'
netconf-interfaces:all
'
netconf_all_key
=
'
netconf-interfaces:all
'
lab_netconf_all_key
=
'
lab:netconf-interfaces:all
'
lab_netconf_all_key
=
'
lab:netconf-interfaces:all
'
...
...
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
sign in
to comment