Prechádzať zdrojové kódy

Fix broken check action (#261).

Dan Helfman 9 mesiacov pred
rodič
commit
2af3522902
2 zmenil súbory, kde vykonal 14 pridanie a 3 odobranie
  1. 12 3
      borgmatic/actions/check.py
  2. 2 0
      borgmatic/hooks/zfs.py

+ 12 - 3
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')
 

+ 2 - 0
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)