From 825ebcf47824c53e3b79ccd864b5e94e3399f12d Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Wed, 1 Mar 2023 18:59:10 +0100 Subject: [PATCH] Revert "Fix --dry-run parameter wasn't working since refactoring" This reverts commit dc6e7e0cc1215e48cdf75e69afa5d83f1e4010f2. --- npbackup/restic_wrapper/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/npbackup/restic_wrapper/__init__.py b/npbackup/restic_wrapper/__init__.py index a23502e..4d26609 100644 --- a/npbackup/restic_wrapper/__init__.py +++ b/npbackup/restic_wrapper/__init__.py @@ -7,8 +7,8 @@ __intname__ = "npbackup.restic_wrapper" __author__ = "Orsiris de Jong" __copyright__ = "Copyright (C) 2022-2023 NetInvent" __license__ = "GPL-3.0-only" -__build__ = "2023030101" -__version__ = "1.5.1" +__build__ = "2023012701" +__version__ = "1.5.0" from typing import Tuple, List, Optional, Callable, Union @@ -181,8 +181,6 @@ class ResticRunner: start_time = datetime.utcnow() self._executor_finished = False _cmd = '"{}" {}{}'.format(self._binary, cmd, self.generic_arguments) - if self.dry_run: - _cmd += " --dry-run" logger.debug("Running command: [{}]".format(_cmd)) self._make_env() if live_stream: @@ -488,6 +486,7 @@ class ResticRunner: use_fs_snapshot: bool = False, tags: List[str] = [], one_file_system: bool = False, + dry_run: bool = False, additional_parameters: str = None, ) -> Tuple[bool, str]: """ @@ -523,6 +522,8 @@ class ResticRunner: logger.warning( "Parameter --use-fs-snapshot was given, which is only compatible with Windows" ) + if dry_run: + cmd += " --dry-run" if additional_parameters: cmd += " {}".format(additional_parameters) result, output = self.executor(cmd, live_stream=True)