mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-09-29 07:05:24 +00:00
pep8 and spelling errors
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import argparse
|
||||
import pprint
|
||||
import sys
|
||||
|
||||
from restic_volume_backup.config import Config
|
||||
from restic_volume_backup.containers import RunningContainers
|
||||
@@ -25,12 +24,12 @@ def main():
|
||||
|
||||
|
||||
def status(config, containers):
|
||||
"""Outputs the backup config for the compse setup"""
|
||||
"""Outputs the backup config for the compose setup"""
|
||||
print()
|
||||
print("Backup config for compose project '{}'".format(containers.this_container.project_name))
|
||||
print("Current service:", containers.this_container.name)
|
||||
print("Backup process :", containers.backup_process_container.name \
|
||||
if containers.backup_process_container else 'Not Running')
|
||||
print("Backup process :", containers.backup_process_container.name
|
||||
if containers.backup_process_container else 'Not Running')
|
||||
print("Backup running :", containers.backup_process_running)
|
||||
|
||||
print()
|
||||
@@ -52,7 +51,7 @@ def backup(config, containers):
|
||||
"""Start backup"""
|
||||
# Make sure we don't spawn multiple backup processes
|
||||
if containers.backup_process_running:
|
||||
raise ValueError("Backup process already running")
|
||||
raise ValueError("Backup process already running")
|
||||
|
||||
print("Initializing repository")
|
||||
|
||||
@@ -73,7 +72,7 @@ def backup(config, containers):
|
||||
image=containers.this_container.image,
|
||||
command='restic-volume-backup start-backup-process',
|
||||
volumes=volumes,
|
||||
enviroment=containers.this_container.environment,
|
||||
environment=containers.this_container.environment,
|
||||
labels={
|
||||
"restic-volume-backup.backup_process": 'True',
|
||||
"com.docker.compose.project": containers.this_container.project_name,
|
||||
@@ -83,7 +82,8 @@ def backup(config, containers):
|
||||
|
||||
def start_backup_process(config, containers):
|
||||
"""Start the backup process container"""
|
||||
if not containers.backup_process_container or containers.this_container == containers.backup_process_container is False:
|
||||
if (not containers.backup_process_container
|
||||
or containers.this_container == containers.backup_process_container is False):
|
||||
print(
|
||||
"Cannot run backup process in this container. Use backup command instead. "
|
||||
"This will spawn a new container with the necessary mounts."
|
||||
@@ -99,6 +99,7 @@ def start_backup_process(config, containers):
|
||||
|
||||
exit(1)
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(prog='restic_volume_backup')
|
||||
parser.add_argument(
|
||||
|
Reference in New Issue
Block a user