Browse Source

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

Dan Helfman 8 years ago
parent
commit
3967e1b5f0
4 changed files with 11 additions and 8 deletions
  1. 6 2
      NEWS
  2. 2 3
      borgmatic/borg.py
  3. 2 2
      borgmatic/tests/unit/test_borg.py
  4. 1 1
      setup.py

+ 6 - 2
NEWS

@@ -1,7 +1,11 @@
+1.1.2
+
+ * #32: Fix for passing check_last as integer to subprocess when calling Borg.
+
 1.1.1
 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.
  * Fix for upgrade-borgmatic-config erroring when consistency checks option is not present.
 
 
 1.1.0
 1.1.0

+ 2 - 3
borgmatic/borg.py

@@ -162,10 +162,9 @@ def _make_check_flags(checks, check_last=None):
 
 
         ('--repository-only',)
         ('--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:
     if checks == DEFAULT_CHECKS:
         return last_flag
         return last_flag
 
 

+ 2 - 2
borgmatic/tests/unit/test_borg.py

@@ -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():
 def test_make_check_flags_with_checks_and_last_returns_flags_including_last():
     flags = module._make_check_flags(('foo', 'bar'), check_last=3)
     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():
 def test_make_check_flags_with_last_returns_last_flag():
     flags = module._make_check_flags(module.DEFAULT_CHECKS, check_last=3)
     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():
 def test_check_archives_should_call_borg_with_parameters():

+ 1 - 1
setup.py

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