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
a1a74aca
Commit
a1a74aca
authored
5 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
more redis current/next debug output
parent
24ff4c8f
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/common.py
+15
-3
15 additions, 3 deletions
inventory_provider/tasks/common.py
with
15 additions
and
3 deletions
inventory_provider/tasks/common.py
+
15
−
3
View file @
a1a74aca
...
...
@@ -72,11 +72,15 @@ def latch_db(config):
def
_get_redis
(
config
,
dbid
=
None
):
if
dbid
is
None
:
logger
.
debug
(
'
no db specified, using minimum as first guess
'
)
dbid
=
min
(
config
[
'
redis-databases
'
])
logger
.
debug
(
'
_get_redis[1], no db specified,
'
'
using minimum as first guess: {}
'
.
format
(
dbid
))
if
dbid
not
in
config
[
'
redis-databases
'
]:
logger
.
error
(
'
tried to connect to unknown db id: {}
'
.
format
(
dbid
))
logger
.
error
(
'
_get_redis[2], tried to connect to unknown db id: {},
'
'
using minimum: {}
'
.
format
(
dbid
,
min
(
config
[
'
redis-databases
'
])))
dbid
=
min
(
config
[
'
redis-databases
'
])
kwargs
=
{
...
...
@@ -106,8 +110,12 @@ def get_current_redis(config):
logger
.
warning
(
"
can
'
t determine current db
"
)
return
r
if
latch
[
'
this
'
]
==
latch
[
'
current
'
]:
logger
.
debug
(
'
get_current_redis[1], using first latch: {}
'
.
format
(
latch
))
return
r
else
:
logger
.
debug
(
'
get_current_redis[2], using current latch: {}
'
.
format
(
latch
))
return
_get_redis
(
config
,
latch
[
'
current
'
])
...
...
@@ -115,13 +123,17 @@ def get_next_redis(config):
r
=
_get_redis
(
config
)
latch
=
get_latch
(
r
)
if
latch
and
latch
[
'
this
'
]
==
latch
[
'
next
'
]:
logger
.
debug
(
'
get_next_redis[1], using first latch: {}
'
.
format
(
latch
))
return
r
if
latch
and
latch
[
'
next
'
]
in
config
[
'
redis-databases
'
]:
logger
.
debug
(
'
get_next_redis[2], using next latch: {}
'
.
format
(
latch
))
next_id
=
latch
[
'
next
'
]
else
:
logger
.
warning
(
"
next db not configured, deriving default value
"
)
db_ids
=
sorted
(
set
(
config
[
'
redis-databases
'
]))
next_id
=
db_ids
[
0
]
if
len
(
db_ids
)
==
1
else
db_ids
[
1
]
logger
.
debug
(
'
get_next_redis[3], next db not configured,
'
'
derived next id: {}
'
.
format
(
next_id
))
return
_get_redis
(
config
,
next_id
)
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