1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 01:37:20 +00:00

Merge pull request #1503 from enkore/issue/1501

Cache: release lock if cache is invalid
This commit is contained in:
TW 2016-08-18 14:24:08 +02:00 committed by GitHub
commit 0fb8f73367

View file

@ -137,9 +137,11 @@ def _do_open(self):
cache_version = self.config.getint('cache', 'version')
wanted_version = 1
if cache_version != wanted_version:
self.close()
raise Exception('%s has unexpected cache version %d (wanted: %d).' % (
config_path, cache_version, wanted_version))
except configparser.NoSectionError:
self.close()
raise Exception('%s does not look like a Borg cache.' % config_path) from None
self.id = self.config.get('cache', 'repository')
self.manifest_id = unhexlify(self.config.get('cache', 'manifest'))