Skip to content
Snippets Groups Projects
Commit 1b989f9b authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Clear interfaces in shared state + bugfix

parent 890dd456
No related branches found
No related tags found
No related merge requests found
...@@ -84,7 +84,7 @@ def delete_expired_api_tokens(request: AdminRequest, org_id: int) -> bool: ...@@ -84,7 +84,7 @@ def delete_expired_api_tokens(request: AdminRequest, org_id: int) -> bool:
tokens = request.get('api/auth/keys', params={'includeExpired': True}) tokens = request.get('api/auth/keys', params={'includeExpired': True})
now = datetime.now() now = datetime.utcnow()
def is_expired(token): def is_expired(token):
date = datetime.strptime(token['expiration'], '%Y-%m-%dT%H:%M:%SZ') date = datetime.strptime(token['expiration'], '%Y-%m-%dT%H:%M:%SZ')
......
...@@ -279,6 +279,13 @@ def _provision_interfaces(config, org_config, ds_name, token): ...@@ -279,6 +279,13 @@ def _provision_interfaces(config, org_config, ds_name, token):
# loop over interfaces and add them to the dashboard_name # loop over interfaces and add them to the dashboard_name
# -> folder mapping structure `dashboards` above, for convenience. # -> folder mapping structure `dashboards` above, for convenience.
for dash in DASHBOARDS:
DASHBOARDS[dash]['interfaces'] = []
for dash in AGG_DASHBOARDS:
AGG_DASHBOARDS[dash]['interfaces'] = []
for iface in relevant_interfaces: for iface in relevant_interfaces:
for dash_name in iface['dashboards']: for dash_name in iface['dashboards']:
...@@ -589,7 +596,7 @@ def provision(config): ...@@ -589,7 +596,7 @@ def provision(config):
for uid in all_original_dashboard_uids - managed_dashboard_uids: for uid in all_original_dashboard_uids - managed_dashboard_uids:
logger.info(f'Deleting stale dashboard with UID {uid}') logger.info(f'Deleting stale dashboard with UID {uid}')
delete_dashboard(token, {'uid': uid}) delete_dashboard(token_request, {'uid': uid})
_delete_unknown_folders(config, token_request) _delete_unknown_folders(config, token_request)
......
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