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
95eed5a6
Commit
95eed5a6
authored
3 years ago
by
Felix Sperling
Browse files
Options
Downloads
Patches
Plain Diff
ignore wrong linter errors
parent
63828c6b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
grafana_backup/azure_storage_upload.py
+3
-3
3 additions, 3 deletions
grafana_backup/azure_storage_upload.py
grafana_backup/gcs_upload.py
+1
-1
1 addition, 1 deletion
grafana_backup/gcs_upload.py
grafana_backup/s3_upload.py
+1
-1
1 addition, 1 deletion
grafana_backup/s3_upload.py
with
5 additions
and
5 deletions
grafana_backup/azure_storage_upload.py
+
3
−
3
View file @
95eed5a6
from
azure.storage.blob
import
BlobServiceClient
,
BlobClient
from
azure.storage.blob
import
BlobServiceClient
def
main
(
args
,
settings
):
azure_storage_container_name
=
settings
.
get
(
'
AZURE_STORAGE_CONTAINER_NAME
'
)
azure_storage_connection_string
=
settings
.
get
(
'
AZURE_STORAGE_CONNECTION_STRING
'
)
backup_dir
=
settings
.
get
(
'
BACKUP_DIR
'
)
timestamp
=
settings
.
get
(
'
TIMESTAMP
'
)
...
...
@@ -17,7 +17,7 @@ def main(args, settings):
with
open
(
archive_file
,
'
rb
'
)
as
data
:
container_client
.
upload_blob
(
data
)
print
(
"
Upload to Azure Storage was successful
"
)
except
FileNotFoundError
:
except
FileNotFoundError
:
# noqa: F821
print
(
"
The file was not found
"
)
return
False
except
Exception
as
e
:
...
...
This diff is collapsed.
Click to expand it.
grafana_backup/gcs_upload.py
+
1
−
1
View file @
95eed5a6
...
...
@@ -19,7 +19,7 @@ def main(args, settings):
blob
.
upload_from_filename
(
archive_file
)
print
(
"
Upload to gcs: was successful
"
)
except
FileNotFoundError
:
except
FileNotFoundError
:
# noqa: F821
print
(
"
The file: {0} was not found
"
.
format
(
gcs_file_name
))
return
False
except
api_core
.
exceptions
.
Forbidden
as
e
:
...
...
This diff is collapsed.
Click to expand it.
grafana_backup/s3_upload.py
+
1
−
1
View file @
95eed5a6
...
...
@@ -32,7 +32,7 @@ def main(args, settings):
try
:
s3_object
.
put
(
Body
=
open
(
archive_file
,
'
rb
'
))
print
(
"
Upload to S3 was successful
"
)
except
FileNotFoundError
:
except
FileNotFoundError
:
# noqa: F821
print
(
"
The file was not found
"
)
return
False
except
NoCredentialsError
:
...
...
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