#32: Fix for passing check_last as integer to subprocess when calling Borg.

This commit is contained in:
Dan Helfman 2017-07-24 19:29:26 -07:00
parent 8cbd51512b
commit 3967e1b5f0
4 changed files with 11 additions and 8 deletions

8
NEWS
View file

@ -1,7 +1,11 @@
1.1.2
* #32: Fix for passing check_last as integer to subprocess when calling Borg.
1.1.1
* #32: Fix for upgrade-borgmatic-config converting check_last option as a string instead of an
integer.
* Part of #32: Fix for upgrade-borgmatic-config converting check_last option as a string instead of
an integer.
* Fix for upgrade-borgmatic-config erroring when consistency checks option is not present.
1.1.0

View file

@ -162,10 +162,9 @@ def _make_check_flags(checks, check_last=None):
('--repository-only',)
Additionally, if a check_last value is given, a "--last" flag will be added. Note that only
Borg supports this flag.
Additionally, if a check_last value is given, a "--last" flag will be added.
'''
last_flag = ('--last', check_last) if check_last else ()
last_flag = ('--last', str(check_last)) if check_last else ()
if checks == DEFAULT_CHECKS:
return last_flag

View file

@ -409,13 +409,13 @@ def test_make_check_flags_with_default_checks_returns_no_flags():
def test_make_check_flags_with_checks_and_last_returns_flags_including_last():
flags = module._make_check_flags(('foo', 'bar'), check_last=3)
assert flags == ('--foo-only', '--bar-only', '--last', 3)
assert flags == ('--foo-only', '--bar-only', '--last', '3')
def test_make_check_flags_with_last_returns_last_flag():
flags = module._make_check_flags(module.DEFAULT_CHECKS, check_last=3)
assert flags == ('--last', 3)
assert flags == ('--last', '3')
def test_check_archives_should_call_borg_with_parameters():

View file

@ -1,7 +1,7 @@
from setuptools import setup, find_packages
VERSION = '1.1.1'
VERSION = '1.1.2'
setup(