From 8c605f213a9c015886dc3923ee7131f50cd554cb Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Mon, 23 May 2022 14:32:51 +0300 Subject: [PATCH] Ensure umount isn't called when self.mounted_tmpfs=False This is accomplished by calling SysGeneral's __del__() method, in which self.mounted_tmpfs is already checked. --- sysc.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sysc.py b/sysc.py index 19f2400..3e6c317 100755 --- a/sysc.py +++ b/sysc.py @@ -38,9 +38,8 @@ class SysC(SysGeneral): if not self.chroot: print(f"Deleting {self.dev_name}") run('sudo', 'losetup', '-d', self.dev_name) - print(f"Unmounting tmpfs from {self.tmp_dir}") - umount(self.tmp_dir) - os.rmdir(self.tmp_dir) + + super().__del__() def prepare(self): """