mirror of
https://github.com/borgbackup/borg.git
synced 2026-05-25 02:33:15 -04:00
Merge pull request #8595 from ThomasWaldmann/storage-quota-zero-1.4
config: fix acceptance of storage_quota 0, fixes #8499
This commit is contained in:
commit
6bbbf3c6ec
1 changed files with 4 additions and 2 deletions
|
|
@ -209,7 +209,7 @@ def with_archive(method):
|
|||
|
||||
def parse_storage_quota(storage_quota):
|
||||
parsed = parse_file_size(storage_quota)
|
||||
if parsed < parse_file_size('10M'):
|
||||
if parsed != 0 and parsed < parse_file_size('10M'):
|
||||
raise argparse.ArgumentTypeError('quota is too small (%s). At least 10M are required.' % storage_quota)
|
||||
return parsed
|
||||
|
||||
|
|
@ -1919,7 +1919,9 @@ class Archiver:
|
|||
except ValueError:
|
||||
raise ValueError('Invalid value') from None
|
||||
if name == 'storage_quota':
|
||||
if parse_file_size(value) < parse_file_size('10M'):
|
||||
wanted = parse_file_size(value)
|
||||
minimum = parse_file_size('10M')
|
||||
if wanted != 0 and wanted < minimum:
|
||||
raise ValueError('Invalid value: storage_quota < 10M')
|
||||
elif name == 'max_segment_size':
|
||||
if parse_file_size(value) >= MAX_SEGMENT_SIZE_LIMIT:
|
||||
|
|
|
|||
Loading…
Reference in a new issue