From 98e972a49a405621fb5839d218a35ec3b7d89136 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 31 Aug 2020 17:32:03 +0200 Subject: [PATCH] Get rid of unimplemented Borg stuff because that code is complicated enough already -_- --- locales/en.json | 3 --- src/yunohost/backup.py | 27 +++------------------------ 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/locales/en.json b/locales/en.json index abc1c1092..23cf92f0d 100644 --- a/locales/en.json +++ b/locales/en.json @@ -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", diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index 0d97617c9..76e18ad87 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -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: