mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-08-01 06:03:02 +02:00
For the "mount" action, fix use of "--log-json" when "--foreground" is set (#485).
This commit is contained in:
@@ -32,7 +32,7 @@ def mount_archive(
|
||||
(local_path, 'mount')
|
||||
+ (('--remote-path', remote_path) if remote_path else ())
|
||||
+ (('--umask', str(umask)) if umask else ())
|
||||
+ ('--log-json',)
|
||||
+ (('--log-json',) if not mount_arguments.foreground else ())
|
||||
+ (('--lock-wait', str(lock_wait)) if lock_wait else ())
|
||||
+ (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())
|
||||
+ (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
|
||||
|
||||
@@ -273,7 +273,7 @@ def test_mount_archive_calls_borg_with_foreground_parameter():
|
||||
flexmock(module.environment).should_receive('make_environment')
|
||||
flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
|
||||
flexmock(module).should_receive('execute_command').with_args(
|
||||
('borg', 'mount', '--log-json', '--foreground', 'repo::archive', '/mnt'),
|
||||
('borg', 'mount', '--foreground', 'repo::archive', '/mnt'),
|
||||
output_file=module.DO_NOT_CAPTURE,
|
||||
environment=None,
|
||||
working_directory=None,
|
||||
|
||||
Reference in New Issue
Block a user