mirror of https://github.com/borgbackup/borg.git
[BUGFIX] Borg config --list does not show last_segment_checked, #5159
fixes #5159
This commit is contained in:
parent
fae0b9b1ee
commit
94189b3203
|
@ -1659,7 +1659,7 @@ class Archiver:
|
||||||
def repo_validate(section, name, value=None, check_value=True):
|
def repo_validate(section, name, value=None, check_value=True):
|
||||||
if section not in ['repository', ]:
|
if section not in ['repository', ]:
|
||||||
raise ValueError('Invalid section')
|
raise ValueError('Invalid section')
|
||||||
if name in ['segments_per_dir', 'max_segment_size', 'storage_quota', ]:
|
if name in ['segments_per_dir', 'max_segment_size', 'storage_quota', 'last_segment_checked', ]:
|
||||||
if check_value:
|
if check_value:
|
||||||
try:
|
try:
|
||||||
int(value)
|
int(value)
|
||||||
|
@ -1716,6 +1716,11 @@ class Archiver:
|
||||||
if value is None:
|
if value is None:
|
||||||
raise Error('The repository config is missing the %s key which has no default value' % key)
|
raise Error('The repository config is missing the %s key which has no default value' % key)
|
||||||
print('%s = %s' % (key, value))
|
print('%s = %s' % (key, value))
|
||||||
|
for key in ['last_segment_checked', ]:
|
||||||
|
value = config.get('repository', key, fallback=None)
|
||||||
|
if value is None:
|
||||||
|
continue
|
||||||
|
print('%s = %s' % (key, value))
|
||||||
|
|
||||||
if not args.list:
|
if not args.list:
|
||||||
if args.name is None:
|
if args.name is None:
|
||||||
|
|
|
@ -2991,6 +2991,17 @@ id: 2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02
|
||||||
self.assert_in('append_only', output)
|
self.assert_in('append_only', output)
|
||||||
self.assert_in('additional_free_space', output)
|
self.assert_in('additional_free_space', output)
|
||||||
self.assert_in('id', output)
|
self.assert_in('id', output)
|
||||||
|
self.assert_not_in('last_segment_checked', output)
|
||||||
|
|
||||||
|
output = self.cmd('config', self.repository_location, 'last_segment_checked', exit_code=1)
|
||||||
|
self.assert_in('No option ', output)
|
||||||
|
self.cmd('config', self.repository_location, 'last_segment_checked', '123')
|
||||||
|
output = self.cmd('config', self.repository_location, 'last_segment_checked')
|
||||||
|
assert output == '123' + '\n'
|
||||||
|
output = self.cmd('config', '--list', self.repository_location)
|
||||||
|
self.assert_in('last_segment_checked', output)
|
||||||
|
self.cmd('config', '--delete', self.repository_location, 'last_segment_checked')
|
||||||
|
|
||||||
for cfg_key, cfg_value in [
|
for cfg_key, cfg_value in [
|
||||||
('additional_free_space', '2G'),
|
('additional_free_space', '2G'),
|
||||||
('repository.append_only', '1'),
|
('repository.append_only', '1'),
|
||||||
|
@ -3002,6 +3013,7 @@ id: 2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02
|
||||||
assert output == cfg_value + '\n'
|
assert output == cfg_value + '\n'
|
||||||
self.cmd('config', '--delete', self.repository_location, cfg_key)
|
self.cmd('config', '--delete', self.repository_location, cfg_key)
|
||||||
self.cmd('config', self.repository_location, cfg_key, exit_code=1)
|
self.cmd('config', self.repository_location, cfg_key, exit_code=1)
|
||||||
|
|
||||||
self.cmd('config', '--list', '--delete', self.repository_location, exit_code=2)
|
self.cmd('config', '--list', '--delete', self.repository_location, exit_code=2)
|
||||||
self.cmd('config', self.repository_location, exit_code=2)
|
self.cmd('config', self.repository_location, exit_code=2)
|
||||||
self.cmd('config', self.repository_location, 'invalid-option', exit_code=1)
|
self.cmd('config', self.repository_location, 'invalid-option', exit_code=1)
|
||||||
|
|
Loading…
Reference in New Issue