From fe134ec2f59514813e0d3df6daf5f35197e71230 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 18 Oct 2020 17:05:50 +0200 Subject: Do not pass data dir to Target.save(). It is not used there. --- lbup/repository.py | 2 +- lbup/targets.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lbup/repository.py b/lbup/repository.py index 8275910..377be61 100644 --- a/lbup/repository.py +++ b/lbup/repository.py @@ -72,7 +72,7 @@ class Repo: for tgt in tgts: self._logger.info('Backing up %s...' % tgt.name) try: - res = tgt.save(self.data_dir, dry_run) + res = tgt.save(dry_run) except Exception as e: self._logger.exception('Exception backing up %s: %s' % (tgt.name, str(e))) res = StepResult(False, str(e).encode('utf-8')) diff --git a/lbup/targets.py b/lbup/targets.py index 37abe55..2b4908f 100644 --- a/lbup/targets.py +++ b/lbup/targets.py @@ -132,11 +132,11 @@ class Target(ABC): return result @abstractmethod - def save(self, data_dir, dry_run = False): + def save(self, dry_run = False): pass class TargetLocal(Target): - def save(self, data_dir, dry_run = False): + def save(self, dry_run = False): return self._do_save(['bup'], dry_run) class TargetSSH(Target): @@ -194,7 +194,7 @@ class TargetSSH(Target): raise BackupException('Invalid BUP_DIR on the remote target: %s' % str(bupdir)) return bupdir[0] - def save(self, data_dir, dry_run = False): + def save(self, dry_run = False): with _ssh_client.SSHConnection(self._remote) as ssh: remote_bupdir = self._resolve_remote_bupdir(ssh) @@ -324,7 +324,7 @@ class TargetSSHLVM(TargetSSH): self._paramiko_exec_cmd(ssh, 'umount %s' % mount_path) - def save(self, data_dir, dry_run = False): + def save(self, dry_run = False): with contextlib.ExitStack() as stack: conn_tgt = stack.enter_context(_ssh_client.SSHConnection(self._remote)) @@ -393,7 +393,7 @@ class TargetSSHLXCLVM(TargetSSHLVM): return "%s{LXC:%s/%s@[%s]}{LVM:%s}" % (super().__str__(), self._lxc_containername, self._lxc_username, str(self._parent_remote), self._snapshot_size) - def save(self, data_dir, dry_run = False): + def save(self, dry_run = False): with contextlib.ExitStack() as stack: parent = stack.enter_context(_ssh_client.SSHConnection(self._parent_remote)) container = stack.enter_context(_ssh_client.SSHConnection(self._remote)) -- cgit v1.2.3