瀏覽代碼

check: fail if single archive does not exist

Marian Beermann 8 年之前
父節點
當前提交
be8e0c89b3
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 4 0
      borg/archive.py
  2. 1 0
      docs/changes.rst

+ 4 - 0
borg/archive.py

@@ -1107,6 +1107,10 @@ class ArchiveChecker:
             archive_items = [item for item in self.manifest.archives.items() if item[0] == archive]
             archive_items = [item for item in self.manifest.archives.items() if item[0] == archive]
             num_archives = 1
             num_archives = 1
             end = 1
             end = 1
+            if not archive_items:
+                logger.error('Archive %s does not exist', archive)
+                self.error_found = True
+                return
 
 
         with cache_if_remote(self.repository) as repository:
         with cache_if_remote(self.repository) as repository:
             for i, (name, info) in enumerate(archive_items[:end]):
             for i, (name, info) in enumerate(archive_items[:end]):

+ 1 - 0
docs/changes.rst

@@ -136,6 +136,7 @@ Bug fixes:
 - Fixed "borg upgrade --tam" crashing with unencrypted repositories. Since :ref:`the issue <tam_vuln>` is
 - Fixed "borg upgrade --tam" crashing with unencrypted repositories. Since :ref:`the issue <tam_vuln>` is
   not relevant for unencrypted repositories, it now does nothing and prints an error, #1981.
   not relevant for unencrypted repositories, it now does nothing and prints an error, #1981.
 - Fixed change-passphrase crashing with unencrypted repositories, #1978
 - Fixed change-passphrase crashing with unencrypted repositories, #1978
+- Fixed "borg check repo::archive" indicating success if "archive" does not exist, #1997
 
 
 Version 1.0.9 (2016-12-20)
 Version 1.0.9 (2016-12-20)
 --------------------------
 --------------------------