Skip to content
Snippets Groups Projects
Commit 30a937fe authored by Aaron Johnson's avatar Aaron Johnson
Browse files

removed unused restore_from_dir function

parent f7e95651
No related branches found
No related tags found
No related merge requests found
......@@ -121,30 +121,3 @@ def restore_components(args, settings, restore_functions, tmpdir):
file_path = os.path.join(root, filename)
print('restoring {0}: {1}'.format(ext, file_path))
restore_functions[ext](args, settings, file_path)
def restore_from_dir(args, arg_components, settings, restore_dir):
restore_functions = { 'folder': create_folder,
'folder_permissions': update_folder_permissions,
'datasource': create_datasource,
'dashboard': create_dashboard,
'alert_channel': create_alert_channel,
'organization': create_org,
'user': create_user }
if arg_components:
arg_components_list = arg_components.split(',')
# Restore only the components that provided via an argument
# but must also exist in extracted archive
for ext in arg_components_list:
for file_path in glob('{0}/**/*.{1}'.format(restore_dir, ext[:-1]), recursive=True):
print('restoring {0}: {1}'.format(ext, file_path))
restore_functions[ext[:-1]](args, settings, file_path)
else:
# Restore every component included in extracted archive
for ext in restore_functions.keys():
for file_path in glob('{0}/**/*.{1}'.format(restore_dir, ext), recursive=True):
print('restoring {0}: {1}'.format(ext, file_path))
restore_functions[ext](args, settings, file_path)
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