From 559bb8577a0fa763c138ad564203bc4f258f0def Mon Sep 17 00:00:00 2001 From: Bjarke Madsen <bjarke.madsen@geant.org> Date: Fri, 19 Feb 2021 11:30:27 +0100 Subject: [PATCH] Update config structure. Now includes excluded dashboards and NRENs per org. --- brian_dashboard_manager/config.py | 17 ++++++++++++++++- test/conftest.py | 25 +++++++++++++++++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/brian_dashboard_manager/config.py b/brian_dashboard_manager/config.py index ef05a1a..e97ce11 100644 --- a/brian_dashboard_manager/config.py +++ b/brian_dashboard_manager/config.py @@ -29,6 +29,19 @@ CONFIG_SCHEMA = { "isDefault", "readOnly" ] + }, + "organization": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "excluded_nrens": {"type": "array", "items": {"type": "string"}}, + "excluded_dashboards": {"type": "array", "items": {"type": "string"}}, + }, + "required": [ + "name", + "excluded_nrens", + "excluded_dashboards" + ] } }, @@ -38,7 +51,8 @@ CONFIG_SCHEMA = { "admin_password": {"type": "string"}, "hostname": {"type": "string"}, "listen_port": {"type": "integer"}, - "organizations": {"type": "array", "items": {"type": "string"}}, + "inventory_provider": {"type": "string"}, + "organizations": {"type": "array", "items": {"$ref": "#definitions/organization"}}, "datasources": { "type": "object", "properties": { @@ -51,6 +65,7 @@ CONFIG_SCHEMA = { "admin_username", "admin_password", "hostname", + "inventory_provider", "organizations", "datasources" ], diff --git a/test/conftest.py b/test/conftest.py index 39e0477..09de236 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -11,11 +11,28 @@ def data_config(): "admin_username": "fakeadmin", "admin_password": "fakeadmin", "hostname": "myfakehostname.org", + "inventory_provider": "inventory-provider01.geant.org:8080", "organizations": [ - 'Testorg1', - 'GÉANT Testorg2', - 'NRENsTestorg3', - 'General Public' + { + "name": "Testorg1", + "excluded_nrens": [], + "excluded_dashboards": [] + }, + { + "name": "GÉANT Testorg2", + "excluded_nrens": [], + "excluded_dashboards": [] + }, + { + "name": "NRENsTestorg3", + "excluded_nrens": [], + "excluded_dashboards": [] + }, + { + "name": "General Public", + "excluded_nrens": ["JISC", "PSNC"], + "excluded_dashboards": [] + } ], "datasources": { "influxdb": { -- GitLab