Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
brian-dashboard-manager
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
brian
brian-dashboard-manager
Commits
d18ece36
Commit
d18ece36
authored
3 years ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
sphinx docs and provision test fix
parent
0207198e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/source/conf.py
+7
-7
7 additions, 7 deletions
docs/source/conf.py
docs/source/configuration.rst
+5
-1
5 additions, 1 deletion
docs/source/configuration.rst
docs/source/index.rst
+2
-2
2 additions, 2 deletions
docs/source/index.rst
test/test_update.py
+9
-6
9 additions, 6 deletions
test/test_update.py
with
23 additions
and
16 deletions
docs/source/conf.py
+
7
−
7
View file @
d18ece36
...
...
@@ -25,7 +25,7 @@ import sys
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
..
'
,
'
..
'
,
'
inventory_provid
er
'
)))
'
..
'
,
'
..
'
,
'
brian_dashboard_manag
er
'
)))
class
RenderAsJSON
(
Directive
):
...
...
@@ -37,14 +37,14 @@ class RenderAsJSON(Directive):
module_path
,
member_name
=
self
.
arguments
[
0
].
rsplit
(
'
.
'
,
1
)
member_data
=
getattr
(
import_module
(
module_path
),
member_name
)
code
=
json
.
dumps
(
member_data
,
indent
=
2
)
code
=
json
.
dumps
(
member_data
,
indent
=
2
,
ensure_ascii
=
False
)
literal
=
nodes
.
literal_block
(
code
,
code
)
literal
[
'
language
'
]
=
'
json
'
return
[
addnodes
.
desc_name
(
text
=
member_name
),
addnodes
.
desc_content
(
''
,
literal
)
addnodes
.
desc_name
(
text
=
member_name
),
addnodes
.
desc_content
(
''
,
literal
)
]
...
...
@@ -68,9 +68,9 @@ release = '0.0'
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions
=
[
'
sphinx_rtd_theme
'
,
'
sphinx.ext.autodoc
'
,
'
sphinx.ext.coverage
'
'
sphinx_rtd_theme
'
,
'
sphinx.ext.autodoc
'
,
'
sphinx.ext.coverage
'
]
# Add any paths that contain templates here, relative to this directory.
...
...
This diff is collapsed.
Click to expand it.
docs/source/configuration.rst
+
5
−
1
View file @
d18ece36
...
...
@@ -12,6 +12,10 @@ similarly to `config.json.example`, and the name
of this file should be stored in the environment
variable `CONFIG_FILENAME` when running the service.
Config
---------
.. automodule:: brian_dashboard_manager.config
Running this module
---------------------
...
...
@@ -29,4 +33,4 @@ This module has been tested in the following execution environments:
* As a `gunicorn` wsgi service.
* Details of `gunicorn` configuration can be found in the
brian_dashboard_manager Puppet repository.
\ No newline at end of file
brian_dashboard_manager Puppet repository.
This diff is collapsed.
Click to expand it.
docs/source/index.rst
+
2
−
2
View file @
d18ece36
...
...
@@ -4,8 +4,8 @@
contain the root `toctree` directive.
Inventory Provid
er
==================
BRIAN Dashboard Manag
er
==================
=====
The BRIAN Dashboard Manager is used
provision Organizations and Dashboards in Grafana for BRIAN.
...
...
This diff is collapsed.
Click to expand it.
test/test_update.py
+
9
−
6
View file @
d18ece36
...
...
@@ -2,7 +2,7 @@ import responses
import
json
from
brian_dashboard_manager.templating.nren_access
import
get_nrens
from
brian_dashboard_manager.grafana.provision
import
provision_folder
,
\
generate_all_nrens
generate_all_nrens
,
provision
from
brian_dashboard_manager.grafana.provision
import
is_re_customer
,
\
is_cls
,
is_ias_customer
,
is_ias_private
,
is_ias_public
,
is_ias_upstream
,
\
is_lag_backbone
,
is_phy_upstream
,
is_re_peer
,
is_gcs
,
\
...
...
@@ -236,7 +236,8 @@ def test_provision_folder(data_config, mocker):
for
dashboard
in
dashboards
:
provision_folder
(
None
,
'
testfolder
'
,
dashboards
[
dashboard
],
TEST_INTERFACES
,
'
testdatasource
'
)
TEST_INTERFACES
,
'
testdatasource
'
,
[
'
CLS TESTDASHBOARD
'
])
def
test_provision_nrens
(
data_config
,
mocker
):
...
...
@@ -316,6 +317,11 @@ def test_provision(data_config, mocker, client):
url
=
f
"
{
data_config
[
'
inventory_provider
'
]
}
/poller/interfaces
"
,
callback
=
get_callback
)
responses
.
add_callback
(
method
=
responses
.
GET
,
url
=
f
"
{
data_config
[
'
inventory_provider
'
]
}
/data/interfaces
"
,
callback
=
get_callback
)
def
folder_get
(
request
):
return
200
,
{},
json
.
dumps
([])
...
...
@@ -416,7 +422,4 @@ def test_provision(data_config, mocker, client):
'
brian_dashboard_manager.grafana.provision.delete_api_token
'
)
# we dont care about this, tested separately
_mocked_delete_api_token
.
return_value
=
None
response
=
client
.
get
(
'
/update/
'
,
headers
=
DEFAULT_REQUEST_HEADERS
)
assert
response
.
status_code
==
200
data
=
json
.
loads
(
response
.
data
.
decode
(
'
utf-8
'
))[
'
data
'
]
assert
data
is
not
None
# == EXISTING_ORGS + [PROVISIONED_ORGANIZATION]
provision
(
data_config
)
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