diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-10-18 17:05:50 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-10-18 17:05:50 +0200 |
commit | fe134ec2f59514813e0d3df6daf5f35197e71230 (patch) | |
tree | a663d85ca0213480418668ecdac250144d63d235 | |
parent | 21c759115774e7ab980b210d6f806938fa0b12e5 (diff) |
Do not pass data dir to Target.save().
It is not used there.
-rw-r--r-- | lbup/repository.py | 2 | ||||
-rw-r--r-- | 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)) |