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
e9bea61e
Commit
e9bea61e
authored
5 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
pep8
parent
76f6a6b8
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/db/opsdb.py
+0
-17
0 additions, 17 deletions
inventory_provider/db/opsdb.py
test/test_celery_worker_global.py
+0
-21
0 additions, 21 deletions
test/test_celery_worker_global.py
test/test_msr_routes.py
+0
-2
0 additions, 2 deletions
test/test_msr_routes.py
with
0 additions
and
40 deletions
inventory_provider/db/opsdb.py
+
0
−
17
View file @
e9bea61e
...
...
@@ -537,20 +537,3 @@ def get_service_users(connection, service_ids):
crs
.
execute
(
query
%
'
,
'
.
join
([
str
(
x
)
for
x
in
chunk
]))
for
r
in
crs
.
fetchall
():
yield
{
'
service_id
'
:
r
[
0
],
'
user
'
:
r
[
1
]}
if
__name__
==
'
__main__
'
:
from
inventory_provider.db
import
db
import
json
db_params
=
{
'
hostname
'
:
'
83.97.93.8
'
,
'
dbname
'
:
'
opsdb
'
,
'
username
'
:
'
opsro
'
,
'
password
'
:
'
opsro
'
}
with
db
.
connection
(
db_params
)
as
cx
:
circuits
=
get_access_services
(
cx
)
print
(
json
.
dumps
(
circuits
))
This diff is collapsed.
Click to expand it.
test/test_celery_worker_global.py
+
0
−
21
View file @
e9bea61e
...
...
@@ -40,27 +40,6 @@ def test_update_locations(mocker, mocked_worker_module, mocked_redis):
assert
len
(
list
(
_cached_locations
()))
>
0
def
test_update_locations
(
mocker
,
mocked_worker_module
,
mocked_redis
):
mocker
.
patch
(
'
inventory_provider.db.opsdb.lookup_pop_info
'
,
lambda
c
,
h
:
[{
'
C
'
:
c
,
'
H
'
:
h
}])
def
_cached_locations
():
db
=
backend_db
()
for
k
in
db
.
keys
():
if
k
.
startswith
(
'
opsdb:location:
'
):
yield
k
db
=
backend_db
()
for
k
in
list
(
_cached_locations
()):
del
db
[
k
]
assert
len
(
list
(
_cached_locations
()))
==
0
# sanity
worker
.
update_equipment_locations
()
assert
len
(
list
(
_cached_locations
()))
>
0
def
test_access_services
(
mocker
,
mocked_worker_module
,
mocked_redis
):
opsdb_get_access_services
=
mocker
.
patch
(
...
...
This diff is collapsed.
Click to expand it.
test/test_msr_routes.py
+
0
−
2
View file @
e9bea61e
import
json
import
jsonschema
import
pytest
DEFAULT_REQUEST_HEADERS
=
{
"
Content-type
"
:
"
application/json
"
,
...
...
@@ -48,4 +47,3 @@ def test_access_services(client):
jsonschema
.
validate
(
response_data
,
ACCESS_SERVICES_LIST_SCHEMA
)
assert
response_data
# test data is non-empty
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