Option to retry pumount if failed.
This commit is contained in:
parent
0e206d9f05
commit
be0d4be5c1
@ -59,16 +59,21 @@ def mount_device(dev_path):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def umount_device(dev_mount_path):
|
def umount_device(dev_mount_path):
|
||||||
try:
|
while True:
|
||||||
pumount_cmd = ["pumount", "--luks-force", dev_mount_path]
|
try:
|
||||||
res = subprocess.check_call(pumount_cmd)
|
pumount_cmd = ["pumount", "--luks-force", dev_mount_path]
|
||||||
if res == 0:
|
res = subprocess.check_call(pumount_cmd)
|
||||||
dev_mount_path = None
|
if res == 0:
|
||||||
except Exception as ex:
|
dev_mount_path = None
|
||||||
QMessageBox.warning (None, "Error unmounting backup device!", "<b>Could not unmount {0}.</b><br>\
|
return dev_mount_path
|
||||||
<b>Please unmount it manually using</b><br> pumount {0}.<br><br>\
|
except Exception as ex:
|
||||||
ERROR: {1}".format(dev_mount_path, ex))
|
title = "Error unmounting backup device!"
|
||||||
return dev_mount_path
|
text = "<b>Could not unmount {0}.</b><br>\
|
||||||
|
<b>Please retry or unmount it manually using</b><br> pumount {0}.<br><br>\
|
||||||
|
ERROR: {1}".format(dev_mount_path, ex)
|
||||||
|
button = QMessageBox.warning (None, title, text, QMessageBox.Ok | QMessageBox.Retry, QMessageBox.Retry)
|
||||||
|
if button == QMessageBox.Ok:
|
||||||
|
return dev_mount_path
|
||||||
|
|
||||||
|
|
||||||
def fill_devs_list(dialog):
|
def fill_devs_list(dialog):
|
||||||
|
Loading…
Reference in New Issue
Block a user