diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-10-20 11:03:42 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-10-20 11:03:42 +0200 |
commit | 5ea14e4a132788472205f66be68ad1540ad56243 (patch) | |
tree | 5c9416e6af6eddd39d940dc06f8bfbeda65fb356 | |
parent | 42164da16c6ce187d1f5c19dc5083165d94da075 (diff) |
TargetSSHLVM: move the snapshot mount out of try-finally
Currently it would try to unmount the snapshot even if mounting failed.
-rw-r--r-- | lbup/targets.py | 2 |
1 files changed, 1 insertions, 1 deletions
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) |