소스 검색

debug dump-repo-objs should not depend on a manifest obj

thus, we should not use the with_repository decorator to set up
the key as it uses Manifest.load() to set up the key.

if the Manifest is lost, that does not work.

but we can use some arbitrary object to set up the key, so just
do that.
Thomas Waldmann 7 년 전
부모
커밋
2e1f2e84d7
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      src/borg/archiver.py

+ 8 - 2
src/borg/archiver.py

@@ -1884,9 +1884,15 @@ class Archiver:
             json.dump(meta, fd, indent=4)
         return EXIT_SUCCESS
 
-    @with_repository(compatibility=Manifest.NO_OPERATION_CHECK)
-    def do_debug_dump_repo_objs(self, args, repository, manifest, key):
+    @with_repository(manifest=False)
+    def do_debug_dump_repo_objs(self, args, repository):
         """dump (decrypted, decompressed) repo objects"""
+        from .crypto.key import key_factory
+        # set up the key without depending on a manifest obj
+        ids = repository.list(limit=1, marker=None)
+        cdata = repository.get(ids[0])
+        key = key_factory(repository, cdata)
+
         marker = None
         i = 0
         while True: