Skip to content
Snippets Groups Projects
Commit eeb1b3ed authored by Felix Sperling's avatar Felix Sperling
Browse files

two fixes for folder names with dashes and alerts-channels

parent 05f99235
No related branches found
No related tags found
No related merge requests found
...@@ -250,14 +250,14 @@ def get_folder_permissions(uid, grafana_url, http_get_headers, verify_ssl, clien ...@@ -250,14 +250,14 @@ def get_folder_permissions(uid, grafana_url, http_get_headers, verify_ssl, clien
def update_folder_permissions(payload, grafana_url, http_post_headers, verify_ssl, client_cert, debug): def update_folder_permissions(payload, grafana_url, http_post_headers, verify_ssl, client_cert, debug):
items = json.dumps({'items': payload}) items = json.dumps({'items': payload})
return send_grafana_post('{0}/api/folders/{1}/permissions'.format(grafana_url,payload[0]['uid']), items, http_post_headers, verify_ssl, client_cert, return send_grafana_post('{0}/api/folders/{1}/permissions'.format(grafana_url, payload[0]['uid']), items, http_post_headers, verify_ssl, client_cert,
debug) debug)
def get_folder_id_from_old_folder_url(folder_url, grafana_url, http_post_headers, verify_ssl, client_cert, debug): def get_folder_id_from_old_folder_url(folder_url, grafana_url, http_post_headers, verify_ssl, client_cert, debug):
if folder_url != "": if folder_url != "":
# Get folder uid # Get folder uid
matches = re.search('dashboards\/[A-Za-z0-9]{1}\/(.*)\/.*', folder_url) matches = re.search('dashboards\/[-A-Za-z0-9]{1}\/(.*)\/.*', folder_url)
uid = matches.group(1) uid = matches.group(1)
response = get_folder(uid, grafana_url, http_post_headers, verify_ssl, client_cert, debug) response = get_folder(uid, grafana_url, http_post_headers, verify_ssl, client_cert, debug)
......
...@@ -22,7 +22,7 @@ def main(args, settings): ...@@ -22,7 +22,7 @@ def main(args, settings):
backup_functions = {'dashboards': save_dashboards, backup_functions = {'dashboards': save_dashboards,
'datasources': save_datasources, 'datasources': save_datasources,
'folders': save_folders, 'folders': save_folders,
'alert-channels': save_alert_channels, 'alert_channels': save_alert_channels,
'organizations': save_orgs, 'organizations': save_orgs,
'users': save_users, 'users': save_users,
'snapshots': save_snapshots, 'snapshots': save_snapshots,
......
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