From 18b3b569d03dc6c50d848208be1bee71dbd786a9 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 12 Jul 2023 09:39:45 -0700 Subject: [PATCH] Fix broken bootstrap action (#721). --- borgmatic/actions/config/bootstrap.py | 2 -- tests/end-to-end/test_borgmatic.py | 9 ++++++++- tests/end-to-end/test_override.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/borgmatic/actions/config/bootstrap.py b/borgmatic/actions/config/bootstrap.py index 2f5acbd4..ee167478 100644 --- a/borgmatic/actions/config/bootstrap.py +++ b/borgmatic/actions/config/bootstrap.py @@ -43,7 +43,6 @@ def get_config_paths(bootstrap_arguments, global_arguments, local_borg_version): ), [borgmatic_manifest_path], {}, - {}, local_borg_version, global_arguments, extract_to_stdout=True, @@ -95,7 +94,6 @@ def run_bootstrap(bootstrap_arguments, global_arguments, local_borg_version): ), [config_path.lstrip(os.path.sep) for config_path in manifest_config_paths], {}, - {}, local_borg_version, global_arguments, extract_to_stdout=False, diff --git a/tests/end-to-end/test_borgmatic.py b/tests/end-to-end/test_borgmatic.py index 93fd27a2..d4d8629b 100644 --- a/tests/end-to-end/test_borgmatic.py +++ b/tests/end-to-end/test_borgmatic.py @@ -22,7 +22,7 @@ def generate_configuration(config_path, repository_path): .replace('- /home', f'- {config_path}') .replace('- /etc', '') .replace('- /var/log/syslog*', '') - + 'storage:\n encryption_passphrase: "test"' + + 'encryption_passphrase: "test"' ) config_file = open(config_path, 'w') config_file.write(config) @@ -74,6 +74,13 @@ def test_borgmatic_command(): assert len(parsed_output) == 1 assert 'repository' in parsed_output[0] + + # Exercise the bootstrap action. + output = subprocess.check_output( + f'borgmatic --config {config_path} bootstrap --repository {repository_path}'.split(' '), + ).decode(sys.stdout.encoding) + + assert 'successful' in output finally: os.chdir(original_working_directory) shutil.rmtree(temporary_directory) diff --git a/tests/end-to-end/test_override.py b/tests/end-to-end/test_override.py index 7debc6e2..f0aa8a88 100644 --- a/tests/end-to-end/test_override.py +++ b/tests/end-to-end/test_override.py @@ -21,7 +21,7 @@ def generate_configuration(config_path, repository_path): .replace('- /home', f'- {config_path}') .replace('- /etc', '') .replace('- /var/log/syslog*', '') - + 'storage:\n encryption_passphrase: "test"' + + 'encryption_passphrase: "test"' ) config_file = open(config_path, 'w') config_file.write(config)