mirror of
https://github.com/netinvent/npbackup.git
synced 2025-10-16 00:17:22 +08:00
Revert "Fix --dry-run parameter wasn't working since refactoring"
This reverts commit dc6e7e0cc1
.
This commit is contained in:
parent
f867ae6415
commit
825ebcf478
1 changed files with 5 additions and 4 deletions
|
@ -7,8 +7,8 @@ __intname__ = "npbackup.restic_wrapper"
|
||||||
__author__ = "Orsiris de Jong"
|
__author__ = "Orsiris de Jong"
|
||||||
__copyright__ = "Copyright (C) 2022-2023 NetInvent"
|
__copyright__ = "Copyright (C) 2022-2023 NetInvent"
|
||||||
__license__ = "GPL-3.0-only"
|
__license__ = "GPL-3.0-only"
|
||||||
__build__ = "2023030101"
|
__build__ = "2023012701"
|
||||||
__version__ = "1.5.1"
|
__version__ = "1.5.0"
|
||||||
|
|
||||||
|
|
||||||
from typing import Tuple, List, Optional, Callable, Union
|
from typing import Tuple, List, Optional, Callable, Union
|
||||||
|
@ -181,8 +181,6 @@ class ResticRunner:
|
||||||
start_time = datetime.utcnow()
|
start_time = datetime.utcnow()
|
||||||
self._executor_finished = False
|
self._executor_finished = False
|
||||||
_cmd = '"{}" {}{}'.format(self._binary, cmd, self.generic_arguments)
|
_cmd = '"{}" {}{}'.format(self._binary, cmd, self.generic_arguments)
|
||||||
if self.dry_run:
|
|
||||||
_cmd += " --dry-run"
|
|
||||||
logger.debug("Running command: [{}]".format(_cmd))
|
logger.debug("Running command: [{}]".format(_cmd))
|
||||||
self._make_env()
|
self._make_env()
|
||||||
if live_stream:
|
if live_stream:
|
||||||
|
@ -488,6 +486,7 @@ class ResticRunner:
|
||||||
use_fs_snapshot: bool = False,
|
use_fs_snapshot: bool = False,
|
||||||
tags: List[str] = [],
|
tags: List[str] = [],
|
||||||
one_file_system: bool = False,
|
one_file_system: bool = False,
|
||||||
|
dry_run: bool = False,
|
||||||
additional_parameters: str = None,
|
additional_parameters: str = None,
|
||||||
) -> Tuple[bool, str]:
|
) -> Tuple[bool, str]:
|
||||||
"""
|
"""
|
||||||
|
@ -523,6 +522,8 @@ class ResticRunner:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Parameter --use-fs-snapshot was given, which is only compatible with Windows"
|
"Parameter --use-fs-snapshot was given, which is only compatible with Windows"
|
||||||
)
|
)
|
||||||
|
if dry_run:
|
||||||
|
cmd += " --dry-run"
|
||||||
if additional_parameters:
|
if additional_parameters:
|
||||||
cmd += " {}".format(additional_parameters)
|
cmd += " {}".format(additional_parameters)
|
||||||
result, output = self.executor(cmd, live_stream=True)
|
result, output = self.executor(cmd, live_stream=True)
|
||||||
|
|
Loading…
Add table
Reference in a new issue