From d81377a37c84187ca8962665dbfae51f9c0c4a6a Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 8 Oct 2023 12:36:00 +0200 Subject: targets: merge two if blocks This should have the same effect, but is easier to read. --- lbup/targets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lbup') diff --git a/lbup/targets.py b/lbup/targets.py index 64dd80f..c6d7df8 100644 --- a/lbup/targets.py +++ b/lbup/targets.py @@ -108,6 +108,9 @@ class Target(ABC): # save cmd = bup_exec + ['save', '-n', self.name] + save_opts + list(map(str, dirs)) + + retcode = 0 + output = b'' if dry_run: self._logger.debug('Not executing save command: ' + str(cmd)) else: @@ -116,9 +119,6 @@ class Target(ABC): self._log_command('Save', res_save.returncode, res_save.stdout, res_save.stderr) - retcode = 0 - output = b'' - if not dry_run: if res_idx.returncode != 0: retcode = res_idx.returncode output += res_idx.stderr + res_idx.stdout -- cgit v1.2.3