Parcourir la source

remove backup mount dir after unmounting (#587)

Marek Marczykowski il y a 12 ans
Parent
commit
0801ee3c9c
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      qubesmanager/backup_utils.py

+ 2 - 0
qubesmanager/backup_utils.py

@@ -64,6 +64,8 @@ def umount_device(dev_mount_path):
             pumount_cmd = ["pumount", "--luks-force", dev_mount_path]
             res = subprocess.check_call(pumount_cmd)
             if res == 0:
+                if dev_mount_path.startswith('/media/backup'):
+                    os.rmdir(dev_mount_path)
                 dev_mount_path = None
                 return dev_mount_path
         except Exception as ex: