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
60a1cdd9
Commit
60a1cdd9
authored
5 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
pep8
parent
03a91b0f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inventory_provider/tasks/config.py
+2
-2
2 additions, 2 deletions
inventory_provider/tasks/config.py
inventory_provider/tasks/worker.py
+2
-1
2 additions, 1 deletion
inventory_provider/tasks/worker.py
test/conftest.py
+0
-3
0 additions, 3 deletions
test/conftest.py
with
4 additions
and
6 deletions
inventory_provider/tasks/config.py
+
2
−
2
View file @
60a1cdd9
...
@@ -19,7 +19,7 @@ if 'sentinel' in inventory_provider_config:
...
@@ -19,7 +19,7 @@ if 'sentinel' in inventory_provider_config:
params
=
inventory_provider_config
[
'
sentinel
'
]
params
=
inventory_provider_config
[
'
sentinel
'
]
sentinel
=
redis
.
sentinel
.
Sentinel
(
sentinel
=
redis
.
sentinel
.
Sentinel
(
[(
params
[
'
hostname
'
],
int
(
params
[
'
port
'
]))],
[(
params
[
'
hostname
'
],
int
(
params
[
'
port
'
]))],
socket_timeout
=
0.5
)
socket_timeout
=
0.5
)
master
=
sentinel
.
discover_master
(
params
[
'
name
'
])
master
=
sentinel
.
discover_master
(
params
[
'
name
'
])
assert
master
assert
master
_broker_hostname
=
master
[
0
]
_broker_hostname
=
master
[
0
]
...
@@ -35,7 +35,7 @@ if ':' in _broker_hostname:
...
@@ -35,7 +35,7 @@ if ':' in _broker_hostname:
# assume this means hostname is an ipv6 address
# assume this means hostname is an ipv6 address
_broker_hostname
=
'
[%s]
'
%
_broker_hostname
_broker_hostname
=
'
[%s]
'
%
_broker_hostname
broker_url
=
result_backend
=
'
redis://%s:%d/%d
'
%
(
broker_url
=
result_backend
=
'
redis://%s:%d/%d
'
%
(
_broker_hostname
,
_broker_port
,
_broker_db_index
)
_broker_hostname
,
_broker_port
,
_broker_db_index
)
logger
.
debug
(
'
broker_url: %r
'
%
broker_url
)
logger
.
debug
(
'
broker_url: %r
'
%
broker_url
)
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/tasks/worker.py
+
2
−
1
View file @
60a1cdd9
...
@@ -35,7 +35,8 @@ class InventoryTask(Task):
...
@@ -35,7 +35,8 @@ class InventoryTask(Task):
if
InventoryTask
.
config
:
if
InventoryTask
.
config
:
return
return
assert
os
.
path
.
isfile
(
os
.
environ
[
'
INVENTORY_PROVIDER_CONFIG_FILENAME
'
]),
(
assert
os
.
path
.
isfile
(
os
.
environ
[
'
INVENTORY_PROVIDER_CONFIG_FILENAME
'
]),
(
'
config file %r not found
'
%
'
config file %r not found
'
%
os
.
environ
[
'
INVENTORY_PROVIDER_CONFIG_FILENAME
'
])
os
.
environ
[
'
INVENTORY_PROVIDER_CONFIG_FILENAME
'
])
...
...
This diff is collapsed.
Click to expand it.
test/conftest.py
+
0
−
3
View file @
60a1cdd9
...
@@ -3,7 +3,6 @@ import json
...
@@ -3,7 +3,6 @@ import json
import
netifaces
import
netifaces
import
os
import
os
import
re
import
re
import
shutil
import
tempfile
import
tempfile
from
lxml
import
etree
from
lxml
import
etree
...
@@ -110,8 +109,6 @@ class MockedRedis(object):
...
@@ -110,8 +109,6 @@ class MockedRedis(object):
pass
pass
@pytest.fixture
@pytest.fixture
def
cached_test_data
():
def
cached_test_data
():
filename
=
os
.
path
.
join
(
TEST_DATA_DIRNAME
,
"
router-info.json
"
)
filename
=
os
.
path
.
join
(
TEST_DATA_DIRNAME
,
"
router-info.json
"
)
...
...
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