Removed redundant code

This commit is contained in:
Kevin Veen-Birkenbach 2023-12-27 21:36:07 +01:00
parent 9a5b544e0b
commit 0322eee107

View File

@ -189,16 +189,11 @@ def backup_with_containers_paused(volume_name, volume_dir, versions_dir, contain
start_containers(containers)
def backup_mariadb_or_postgres(container, volume_dir):
# Execute MariaDB procedure
if has_image(container, 'mariadb'):
backup_database(container, volume_dir, 'mariadb')
'''Performs database image specific backup procedures'''
for image in ['mariadb','postgres']:
if has_image(container, image):
backup_database(container, volume_dir, image)
return True
# Execute Postgres procedure
if has_image(container, 'postgres'):
backup_database(container, volume_dir, 'postgres')
return True
return False
@ -228,9 +223,11 @@ def default_backup_routine_for_volume(volume_name, containers, version_dir, vers
def backup_everything(volume_name, containers, version_dir, versions_dir):
"""Perform file backup routine for a given volume."""
volume_dir=create_volume_directory(version_dir, volume_name)
# Execute sql dumps
for container in containers:
backup_mariadb_or_postgres(container, volume_dir)
# Execute file backups
backup_volume(volume_name, volume_dir, versions_dir)
backup_with_containers_paused(volume_name, volume_dir, versions_dir, containers)