Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grafana Backup Tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Migrated Projects
Tooling
Grafana Backup Tool
Commits
30a937fe
Commit
30a937fe
authored
3 years ago
by
Aaron Johnson
Browse files
Options
Downloads
Patches
Plain Diff
removed unused restore_from_dir function
parent
f7e95651
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grafana_backup/restore.py
+0
-27
0 additions, 27 deletions
grafana_backup/restore.py
with
0 additions
and
27 deletions
grafana_backup/restore.py
+
0
−
27
View file @
30a937fe
...
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment