From 5ea14e4a132788472205f66be68ad1540ad56243 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 20 Oct 2020 11:03:42 +0200 Subject: TargetSSHLVM: move the snapshot mount out of try-finally Currently it would try to unmount the snapshot even if mounting failed. --- lbup/targets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbup/targets.py b/lbup/targets.py index 6826d81..8b90188 100644 --- a/lbup/targets.py +++ b/lbup/targets.py @@ -315,8 +315,8 @@ class TargetSSHLVM(TargetSSH): then unmounts and destroys it at exit. """ with self._snapshot_lv(ssh, devnum) as lv_path: + self._paramiko_exec_cmd(ssh, 'mount -oro %s %s' % (lv_path, mount_path)) try: - self._paramiko_exec_cmd(ssh, 'mount -oro %s %s' % (lv_path, mount_path)) yield None finally: self._paramiko_exec_cmd(ssh, 'umount %s' % mount_path) -- cgit v1.2.3