mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 09:47:58 +00:00
Merge pull request #6619 from ThomasWaldmann/invalid-repo-msg-master
better error msg for defect or unsupported repo configs, fixes #6566
This commit is contained in:
commit
299196ebcb
1 changed files with 5 additions and 2 deletions
|
@ -446,11 +446,14 @@ def open(self, path, exclusive, lock_wait=None, lock=True):
|
||||||
raise self.InvalidRepository(self.path)
|
raise self.InvalidRepository(self.path)
|
||||||
if 'repository' not in self.config.sections():
|
if 'repository' not in self.config.sections():
|
||||||
self.close()
|
self.close()
|
||||||
raise self.InvalidRepository(path)
|
raise self.InvalidRepositoryConfig(path, 'no repository section found')
|
||||||
self.version = self.config.getint('repository', 'version')
|
self.version = self.config.getint('repository', 'version')
|
||||||
if self.version not in (2, ): # for now, only work on new repos
|
if self.version not in (2, ): # for now, only work on new repos
|
||||||
self.close()
|
self.close()
|
||||||
raise self.InvalidRepository(path)
|
raise self.InvalidRepositoryConfig(
|
||||||
|
path,
|
||||||
|
'repository version %d is not supported by this borg version' % self.version
|
||||||
|
)
|
||||||
self.max_segment_size = parse_file_size(self.config.get('repository', 'max_segment_size'))
|
self.max_segment_size = parse_file_size(self.config.get('repository', 'max_segment_size'))
|
||||||
if self.max_segment_size >= MAX_SEGMENT_SIZE_LIMIT:
|
if self.max_segment_size >= MAX_SEGMENT_SIZE_LIMIT:
|
||||||
self.close()
|
self.close()
|
||||||
|
|
Loading…
Reference in a new issue