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
1b181d70
Commit
1b181d70
authored
5 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
pep8
parent
eaf6c5b7
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
+4
-1
4 additions, 1 deletion
inventory_provider/db/opsdb.py
inventory_provider/routes/lg.py
+0
-1
0 additions, 1 deletion
inventory_provider/routes/lg.py
test/test_lg_routes.py
+2
-2
2 additions, 2 deletions
test/test_lg_routes.py
with
6 additions
and
4 deletions
inventory_provider/db/opsdb.py
+
4
−
1
View file @
1b181d70
...
...
@@ -337,7 +337,10 @@ WHERE
print
(
row
)
return
{
'
equipment name
'
:
row
[
'
router_name
'
],
'
type
'
:
'
INTERNAL
'
if
row
[
'
pop_name
'
]
in
INTERNAL_POP_NAMES
else
'
CORE
'
,
'
type
'
:
'
INTERNAL
'
if
row
[
'
pop_name
'
]
in
INTERNAL_POP_NAMES
else
'
CORE
'
,
'
pop
'
:
{
'
name
'
:
row
[
'
pop_name
'
],
'
city
'
:
row
[
'
pop_city
'
],
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/routes/lg.py
+
0
−
1
View file @
1b181d70
import
json
import
re
from
flask
import
Blueprint
,
jsonify
,
Response
...
...
This diff is collapsed.
Click to expand it.
test/test_lg_routes.py
+
2
−
2
View file @
1b181d70
...
...
@@ -66,6 +66,7 @@ def test_public_routers(client):
# no internal routers should be present
assert
all
(
r
[
'
type
'
]
==
'
CORE
'
for
r
in
response_data
)
def
test_internal_routers
(
client
):
rv
=
client
.
get
(
'
/lg/routers/all
'
,
...
...
@@ -82,7 +83,6 @@ def test_internal_routers(client):
assert
any
(
r
[
'
type
'
]
==
'
CORE
'
for
r
in
response_data
)
@pytest.mark.parametrize
(
'
bad_endpoint
'
,
[
# bad access param keyword
...
...
@@ -99,7 +99,7 @@ def test_internal_routers(client):
'
/lg/
'
,
'
/lg/something
'
])
def
test_
internal_router
s
(
client
,
bad_endpoint
):
def
test_
bad_endpoint
s
(
client
,
bad_endpoint
):
rv
=
client
.
get
(
bad_endpoint
,
headers
=
DEFAULT_REQUEST_HEADERS
)
...
...
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