ssh/remote: make sure we also cleanup clan-ssh in the error case
This commit is contained in:
@@ -107,7 +107,7 @@ class Remote:
|
||||
"/var/folders/"
|
||||
):
|
||||
directory = "/tmp/"
|
||||
temp_dir = TemporaryDirectory(prefix="clan-ssh", dir=directory)
|
||||
with TemporaryDirectory(prefix="clan-ssh", dir=directory) as temp_dir:
|
||||
yield Remote(
|
||||
address=self.address,
|
||||
user=self.user,
|
||||
@@ -120,9 +120,9 @@ class Remote:
|
||||
verbose_ssh=self.verbose_ssh,
|
||||
ssh_options=self.ssh_options,
|
||||
tor_socks=self.tor_socks,
|
||||
_control_path_dir=Path(temp_dir.name),
|
||||
_control_path_dir=Path(temp_dir),
|
||||
_askpass_path=self._askpass_path,
|
||||
)
|
||||
temp_dir.cleanup()
|
||||
|
||||
def run(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user