From d6dfb8753a0a09cc2998fabd93f8fad78efd4850 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Sat, 25 Mar 2023 01:50:47 +0530 Subject: [PATCH] reformat --- borgmatic/actions/compact.py | 8 +------- borgmatic/actions/export_tar.py | 4 +++- borgmatic/actions/restore.py | 4 +++- borgmatic/commands/borgmatic.py | 2 +- tests/end-to-end/test_borgmatic.py | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/borgmatic/actions/compact.py b/borgmatic/actions/compact.py index e3018af..95334c5 100644 --- a/borgmatic/actions/compact.py +++ b/borgmatic/actions/compact.py @@ -52,13 +52,7 @@ def run_compact( threshold=compact_arguments.threshold, ) else: # pragma: nocover -<<<<<<< HEAD - logger.info( - '{}: Skipping compact (only available/needed in Borg 1.2+)'.format(repository['path']) - ) -======= - logger.info(f'{repository}: Skipping compact (only available/needed in Borg 1.2+)') ->>>>>>> f42890430c59a40a17d9a68a193d6a09674770cb + logger.info(f'{repository["path"]}: Skipping compact (only available/needed in Borg 1.2+)') borgmatic.hooks.command.execute_hook( hooks.get('after_compact'), hooks.get('umask'), diff --git a/borgmatic/actions/export_tar.py b/borgmatic/actions/export_tar.py index 37a870a..ff9f31b 100644 --- a/borgmatic/actions/export_tar.py +++ b/borgmatic/actions/export_tar.py @@ -22,7 +22,9 @@ def run_export_tar( if export_tar_arguments.repository is None or borgmatic.config.validate.repositories_match( repository, export_tar_arguments.repository ): - logger.info(f'{repository["path"]}: Exporting archive {export_tar_arguments.archive} as tar file') + logger.info( + f'{repository["path"]}: Exporting archive {export_tar_arguments.archive} as tar file' + ) borgmatic.borg.export_tar.export_tar_archive( global_arguments.dry_run, repository['path'], diff --git a/borgmatic/actions/restore.py b/borgmatic/actions/restore.py index e718e74..bbbb4c7 100644 --- a/borgmatic/actions/restore.py +++ b/borgmatic/actions/restore.py @@ -255,7 +255,9 @@ def run_restore( ): return - logger.info(f'{repository["path"]}: Restoring databases from archive {restore_arguments.archive}') + logger.info( + f'{repository["path"]}: Restoring databases from archive {restore_arguments.archive}' + ) borgmatic.hooks.dispatch.call_hooks_even_if_unconfigured( 'remove_database_dumps', diff --git a/borgmatic/commands/borgmatic.py b/borgmatic/commands/borgmatic.py index 86f047e..7612970 100644 --- a/borgmatic/commands/borgmatic.py +++ b/borgmatic/commands/borgmatic.py @@ -169,7 +169,7 @@ def run_configuration(config_filename, config, arguments): return encountered_error = error - yield from log_error_records(f'{repository_path}: Error pinging monitor', error) + yield from log_error_records(f'{repository["path"]}: Error pinging monitor', error) if not encountered_error: try: diff --git a/tests/end-to-end/test_borgmatic.py b/tests/end-to-end/test_borgmatic.py index c1653d2..5e915f0 100644 --- a/tests/end-to-end/test_borgmatic.py +++ b/tests/end-to-end/test_borgmatic.py @@ -19,7 +19,7 @@ def generate_configuration(config_path, repository_path): .replace('ssh://user@backupserver/./sourcehostname.borg', repository_path) .replace('- path: /mnt/backup', '') .replace('label: local', '') - .replace('- /home', '- {}'.format(config_path)) + .replace('- /home', f'- {config_path}') .replace('- /etc', '') .replace('- /var/log/syslog*', '') + 'storage:\n encryption_passphrase: "test"'