fix borg config --cache (make sure cache gets closed via try/finally)

This commit is contained in:
Thomas Waldmann 2018-05-05 15:02:07 +02:00
parent 697bb36402
commit 322b442641
1 changed files with 32 additions and 31 deletions

View File

@ -1774,6 +1774,7 @@ class Archiver:
assert_secure(repository, manifest)
cache = Cache(repository, key, manifest, lock_wait=self.lock_wait)
try:
if args.cache:
cache.cache_config.load()
config = cache.cache_config._config
@ -1802,10 +1803,10 @@ class Archiver:
except (configparser.NoOptionError, configparser.NoSectionError) as e:
print(e, file=sys.stderr)
return EXIT_WARNING
return EXIT_SUCCESS
finally:
if args.cache:
cache.close()
return EXIT_SUCCESS
def do_debug_info(self, args):
"""display system information for debugging / bug reports"""