Fix for spurious Borg traceback when initializing a repository in an empty directory (#201).
This commit is contained in:
parent
3495484ddd
commit
9585c8f908
4 changed files with 7 additions and 4 deletions
3
NEWS
3
NEWS
|
@ -1,3 +1,6 @@
|
||||||
|
1.3.16.dev0
|
||||||
|
* #201: Fix for spurious Borg traceback when initializing a repository in an empty directory.
|
||||||
|
|
||||||
1.3.15
|
1.3.15
|
||||||
* #208: Fix for traceback when the "checks" option has an empty value.
|
* #208: Fix for traceback when the "checks" option has an empty value.
|
||||||
* #209: Bypass Borg error about a moved repository via "relocated_repo_access_is_ok" option in
|
* #209: Bypass Borg error about a moved repository via "relocated_repo_access_is_ok" option in
|
||||||
|
|
|
@ -57,7 +57,7 @@ def execute_command(full_command, output_log_level=logging.INFO, shell=False):
|
||||||
logger.debug(' '.join(full_command))
|
logger.debug(' '.join(full_command))
|
||||||
|
|
||||||
if output_log_level is None:
|
if output_log_level is None:
|
||||||
output = subprocess.check_output(full_command, shell=shell)
|
output = subprocess.check_output(full_command, stderr=subprocess.STDOUT, shell=shell)
|
||||||
return output.decode() if output is not None else None
|
return output.decode() if output is not None else None
|
||||||
else:
|
else:
|
||||||
execute_and_log_output(full_command, output_log_level, shell=shell)
|
execute_and_log_output(full_command, output_log_level, shell=shell)
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -1,6 +1,6 @@
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
VERSION = '1.3.15'
|
VERSION = '1.3.16.dev0'
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
|
|
@ -31,7 +31,7 @@ def test_execute_command_captures_output():
|
||||||
full_command = ['foo', 'bar']
|
full_command = ['foo', 'bar']
|
||||||
expected_output = '[]'
|
expected_output = '[]'
|
||||||
flexmock(module.subprocess).should_receive('check_output').with_args(
|
flexmock(module.subprocess).should_receive('check_output').with_args(
|
||||||
full_command, shell=False
|
full_command, stderr=module.subprocess.STDOUT, shell=False
|
||||||
).and_return(flexmock(decode=lambda: expected_output)).once()
|
).and_return(flexmock(decode=lambda: expected_output)).once()
|
||||||
|
|
||||||
output = module.execute_command(full_command, output_log_level=None)
|
output = module.execute_command(full_command, output_log_level=None)
|
||||||
|
@ -43,7 +43,7 @@ def test_execute_command_captures_output_with_shell():
|
||||||
full_command = ['foo', 'bar']
|
full_command = ['foo', 'bar']
|
||||||
expected_output = '[]'
|
expected_output = '[]'
|
||||||
flexmock(module.subprocess).should_receive('check_output').with_args(
|
flexmock(module.subprocess).should_receive('check_output').with_args(
|
||||||
full_command, shell=True
|
full_command, stderr=module.subprocess.STDOUT, shell=True
|
||||||
).and_return(flexmock(decode=lambda: expected_output)).once()
|
).and_return(flexmock(decode=lambda: expected_output)).once()
|
||||||
|
|
||||||
output = module.execute_command(full_command, output_log_level=None, shell=True)
|
output = module.execute_command(full_command, output_log_level=None, shell=True)
|
||||||
|
|
Loading…
Reference in a new issue