Fix broken bootstrap action (#721).

This commit is contained in:
Dan Helfman 2023-07-12 09:39:45 -07:00
parent 054bd52482
commit 18b3b569d0
3 changed files with 9 additions and 4 deletions

View file

@ -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,

View file

@ -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)

View file

@ -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)