Skip to content
Snippets Groups Projects
Commit 40c05c0d authored by Release Webservice's avatar Release Webservice
Browse files

Finished release 0.20.

parents a33e4bdc 87f894b0
No related branches found
Tags 0.20
No related merge requests found
......@@ -189,13 +189,18 @@ CONFIG_SCHEMA = {
},
"additionalProperties": False
},
"ignored_folders": {
"type": "array",
"items": {"type": "string"}
}
},
"required": [
"admin_username",
"admin_password",
"hostname",
"inventory_provider",
"datasources"
"datasources",
"ignored_folders"
]
}
......@@ -206,7 +211,8 @@ def defaults():
"admin_password": "admin",
"hostname": "localhost:3000",
"listen_port": 3001,
"datasources": {}
"datasources": {},
"ignored_folders": []
}
......
......@@ -124,7 +124,7 @@ def _search_dashboard(request: TokenRequest, dashboard: Dict, folder_id=None):
if r and isinstance(r, list):
if len(r) >= 1:
for dash in r:
if dash['title'].lower() == dashboard['title'].lower():
if dash['title'] == dashboard['title']:
definition = _get_dashboard(request, dash['uid'])
return definition
return None
......
......@@ -51,15 +51,7 @@ def provision_folder(token_request, folder_name, dash,
folder = find_folder(token_request, folder_name)
tag = dash['tag']
interfaces = dash['interfaces']
empty_names = [iface for iface in interfaces if not _check_valid(iface)]
if any(empty_names):
for iface in empty_names:
logger.info('Invalid dashboard name on interface:')
logger.info(json.dumps(iface, indent=2))
interfaces = list(filter(_check_valid, interfaces))
interfaces = list(filter(_check_valid, dash['interfaces']))
# dashboard should include error panels
errors = dash.get('errors', False)
......@@ -460,8 +452,12 @@ def provision(config):
# get dashboard UIDs from ignored folders
# and make sure we don't touch them
for name in ignored_folders:
folder = find_folder(request, name)
to_ignore = list_dashboards(request, folder['id'])
logger.info(
f'Ignoring dashboards under the folder {org["name"]}/{name}')
folder = find_folder(token_request, name, create=False)
if folder is None:
continue
to_ignore = list_dashboards(token_request, folder['id'])
for dash in to_ignore:
# mark it updated, so we don't modify it.
......
......@@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.
## [0.20] - 2021-09-13
- Don't automatically create ignored folders, just ignore them if they are present.
## [0.19] - 2021-09-13
- [POL1-501] create config option ignored_folders for provisioning folders with manually maintained dashboards
......
......@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='brian-dashboard-manager',
version="0.19",
version="0.20",
author='GEANT',
author_email='swd@geant.org',
description='',
......
......@@ -45,7 +45,8 @@ def data_config():
"isDefault": True,
"readOnly": False
}
}
},
"ignored_folders": []
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment