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
c4fb1509
Commit
c4fb1509
authored
5 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
use service name in redis key
parent
3943b8de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inventory_provider/tasks/worker.py
+6
-5
6 additions, 5 deletions
inventory_provider/tasks/worker.py
with
6 additions
and
5 deletions
inventory_provider/tasks/worker.py
+
6
−
5
View file @
c4fb1509
...
...
@@ -125,19 +125,20 @@ def update_access_services(self):
with
db
.
connection
(
InventoryTask
.
config
[
"
ops-db
"
])
as
cx
:
for
service
in
opsdb
.
get_access_services
(
cx
):
if
service
[
'
equipment
'
]
in
access_services
:
if
service
[
'
name
'
]
in
access_services
:
logger
.
warning
(
f
'
got multiple access services for
{
service
[
"
equipment
"
]
}
'
)
'
got multiple access services
'
f
'
with name
"
{
service
[
"
name
"
]
}
"'
)
access_services
[
service
[
'
equipment
'
]]
=
service
access_services
[
service
[
'
name
'
]]
=
service
r
=
get_next_redis
(
InventoryTask
.
config
)
for
key
in
r
.
scan_iter
(
'
opsdb:access_services:*
'
):
r
.
delete
(
key
)
rp
=
r
.
pipeline
()
for
equipment_interfac
e
,
service
in
access_services
.
items
():
for
nam
e
,
service
in
access_services
.
items
():
rp
.
set
(
f
'
opsdb:access_services:
{
equipment_interfac
e
}
'
,
f
'
opsdb:access_services:
{
nam
e
}
'
,
json
.
dumps
(
service
))
rp
.
execute
()
...
...
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