Get rid of unimplemented Borg stuff because that code is complicated enough already -_-

This commit is contained in:
Alexandre Aubin 2020-08-31 17:32:03 +02:00
parent 3f1888a041
commit 98e972a49a
2 changed files with 3 additions and 27 deletions

View file

@ -66,7 +66,6 @@
"backup_abstract_method": "This backup method has yet to be implemented",
"backup_actually_backuping": "Creating a backup archive from the collected files…",
"backup_app_failed": "Could not back up the app '{app:s}'",
"backup_applying_method_borg": "Sending all files to backup into borg-backup repository…",
"backup_applying_method_copy": "Copying all files to backup…",
"backup_applying_method_custom": "Calling the custom backup method '{method:s}'…",
"backup_applying_method_tar": "Creating the backup TAR archive…",
@ -80,7 +79,6 @@
"backup_archive_system_part_not_available": "System part '{part:s}' unavailable in this backup",
"backup_archive_writing_error": "Could not add the files '{source:s}' (named in the archive '{dest:s}') to be backed up into the compressed archive '{archive:s}'",
"backup_ask_for_copying_if_needed": "Do you want to perform the backup using {size:s} MB temporarily? (This way is used since some files could not be prepared using a more efficient method.)",
"backup_borg_not_implemented": "The Borg backup method is not yet implemented",
"backup_cant_mount_uncompress_archive": "Could not mount the uncompressed archive as write protected",
"backup_cleaning_failed": "Could not clean up the temporary backup folder",
"backup_copying_to_organize_the_archive": "Copying {size:s}MB to organize the archive",
@ -94,7 +92,6 @@
"backup_delete_error": "Could not delete '{path:s}'",
"backup_deleted": "Backup deleted",
"backup_hook_unknown": "The backup hook '{hook:s}' is unknown",
"backup_method_borg_finished": "Backup into Borg finished",
"backup_method_copy_finished": "Backup copy finalized",
"backup_method_custom_finished": "Custom backup method '{method:s}' finished",
"backup_method_tar_finished": "TAR backup archive created",

View file

@ -1772,9 +1772,8 @@ class BackupMethod(object):
bm_class = {
'copy': CopyBackupMethod,
'tar': TarBackupMethod,
'borg': BorgBackupMethod
}
if method in ["copy", "tar", "borg"]:
if method in ["copy", "tar"]:
return bm_class[method](manager, *args)
else:
return CustomBackupMethod(manager, method=method, *args)
@ -2008,26 +2007,6 @@ class TarBackupMethod(BackupMethod):
tar.close()
class BorgBackupMethod(BackupMethod):
@property
def method_name(self):
return 'borg'
def backup(self):
""" Backup prepared files with borg """
super(CopyBackupMethod, self).backup()
# TODO run borg create command
raise YunohostError('backup_borg_not_implemented')
def mount(self, mnt_path):
raise YunohostError('backup_borg_not_implemented')
def copy(self, file, target):
raise YunohostError('backup_borg_not_implemented')
class CustomBackupMethod(BackupMethod):
"""
@ -2044,7 +2023,7 @@ class CustomBackupMethod(BackupMethod):
@property
def method_name(self):
return 'borg'
return 'custom'
def need_mount(self):
"""Call the backup_method hook to know if we need to organize files
@ -2153,7 +2132,7 @@ def backup_create(name=None, description=None, methods=[],
if no_compress:
methods = ['copy']
else:
methods = ['tar'] # In future, borg will be the default actions
methods = ['tar']
# If no --system or --apps given, backup everything
if system is None and apps is None: