From 115c94aeaa0c1a5a99b895b58c1640bfb8b4e7e8 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 8 Oct 2023 18:44:15 +0200 Subject: targets: always pass dirs/excludes as iterable-of-str to _do_save() This is cleaner. --- lbup/targets.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lbup') diff --git a/lbup/targets.py b/lbup/targets.py index 877f3d7..55702ee 100644 --- a/lbup/targets.py +++ b/lbup/targets.py @@ -131,8 +131,8 @@ class Target(ABC): # index cmd = bup_exec + ['index', '--update', '--one-file-system'] + index_opts - cmd.extend(['--exclude=%s' % str(e) for e in excludes]) - cmd.extend(map(str, dirs)) + cmd.extend(['--exclude=%s' % e for e in excludes]) + cmd.extend(dirs) if dry_run: self._logger.debug('Not executing index command: ' + str(cmd)) @@ -380,8 +380,8 @@ class TargetSSHLVM(TargetSSH): save_opts = ['--graft=%s=%s' % (snapshot_mount, mountpoint)] index_opts = ['--no-check-device'] reparent = (mountpoint, AbsPath(snapshot_mount)) - dirs = [d.reparent(*reparent) for d in dirs] - excludes = [d.reparent(*reparent) for d in excludes] + dirs = [str(d.reparent(*reparent)) for d in dirs] + excludes = [str(d.reparent(*reparent)) for d in excludes] stack.enter_context(self._mount_snapshot(conn_root, devnum, snapshot_mount, fstype)) -- cgit v1.2.3