diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-10-08 12:36:00 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-10-08 12:36:29 +0200 |
commit | d81377a37c84187ca8962665dbfae51f9c0c4a6a (patch) | |
tree | 1baf9b0863719696188c3ae1d398ddda2fafd0dc | |
parent | eee2a77bcd6367c4bd64677b047a81a9de2ad848 (diff) |
targets: merge two if blocks
This should have the same effect, but is easier to read.
-rw-r--r-- | lbup/targets.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 |