From 2af3522902b1c63e6fac0f9af2af11b1056bafc4 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 21 Nov 2024 08:32:02 -0800 Subject: [PATCH] Fix broken check action (#261). --- borgmatic/actions/check.py | 15 ++++++++++++--- borgmatic/hooks/zfs.py | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/borgmatic/actions/check.py b/borgmatic/actions/check.py index 0e977969..2713f25d 100644 --- a/borgmatic/actions/check.py +++ b/borgmatic/actions/check.py @@ -346,7 +346,13 @@ def upgrade_check_times(config, borg_repository_id): def collect_spot_check_source_paths( - repository, config, local_borg_version, global_arguments, local_path, remote_path + repository, + config, + local_borg_version, + global_arguments, + local_path, + remote_path, + borgmatic_runtime_directory, ): ''' Given a repository configuration dict, a configuration dict, the local Borg version, global @@ -368,10 +374,12 @@ def collect_spot_check_source_paths( repository_path=repository['path'], config=config, config_paths=(), - source_directories=borgmatic.actions.create.process_source_directories(config), + source_directories=borgmatic.actions.create.process_source_directories( + config, (), borgmatic_runtime_directory + ), local_borg_version=local_borg_version, global_arguments=global_arguments, - borgmatic_runtime_directories=(), + borgmatic_runtime_directory=borgmatic_runtime_directory, local_path=local_path, remote_path=remote_path, list_files=True, @@ -587,6 +595,7 @@ def spot_check( global_arguments, local_path, remote_path, + borgmatic_runtime_directory, ) logger.debug(f'{log_prefix}: {len(source_paths)} total source paths for spot check') diff --git a/borgmatic/hooks/zfs.py b/borgmatic/hooks/zfs.py index 3d4d049e..1e7cf822 100644 --- a/borgmatic/hooks/zfs.py +++ b/borgmatic/hooks/zfs.py @@ -93,6 +93,7 @@ def dump_data_sources( # up in the Borg archive at the "original" dataset mount point path. snapshot_path = os.path.join( # TODO: Maybe factor out into normalize_runtime_directory() utility function. + '/', *( subdirectory for subdirectory in borgmatic_runtime_directory.split(os.path.sep) @@ -153,6 +154,7 @@ def remove_data_source_dumps(hook_config, config, log_prefix, borgmatic_runtime_ # FIXME: This doesn't necessarily find snapshot mounts from previous borgmatic runs, because # borgmatic_runtime_directory could be in a tempfile-created directory that has a random name. snapshots_directory = os.path.join( + '/', *( subdirectory for subdirectory in borgmatic_runtime_directory.split(os.path.sep)