mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-08-07 00:23:20 +02:00
fix dry run not working borg 1.4.1+
This commit is contained in:
@@ -37,6 +37,11 @@ def compact_segments(
|
||||
+ (('--threshold', str(threshold)) if threshold else ())
|
||||
+ (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())
|
||||
+ (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
|
||||
+ (
|
||||
('--dry-run',)
|
||||
if dry_run and feature.available(feature.Feature.DRY_RUN_COMPACT, local_borg_version)
|
||||
else ()
|
||||
)
|
||||
+ (tuple(extra_borg_options.split(' ')) if extra_borg_options else ())
|
||||
+ flags.make_repository_flags(repository_path, local_borg_version)
|
||||
)
|
||||
|
||||
@@ -73,6 +73,8 @@ def test_compact_segments_with_dry_run_skips_borg_call_when_feature_unavailable(
|
||||
flexmock(module.feature).should_receive('available').with_args(
|
||||
module.feature.Feature.DRY_RUN_COMPACT, '1.2.3'
|
||||
).and_return(False)
|
||||
flexmock(module.environment).should_receive('make_environment').never()
|
||||
flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').never()
|
||||
flexmock(module).should_receive('execute_command').never()
|
||||
flexmock(logging).should_receive('info').with_args('Skipping compact (dry run)').once()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user