aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/isodumper.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index 4c3fa6b..f164547 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -127,7 +127,13 @@ class UDisks2(object):
iface = self.bus.get(self.SERVICE, path_to_encrypted)
fs = iface[self.SERVICE + '.Filesystem']
if fs.MountPoints: # partition is mounted
- fs.Unmount({})
+ try:
+ fs.Unmount({})
+ except GLib.GError as e:
+ print(str(e))
+ return False, _("A partition is busy. Try to free it before starting again.")
+ except:
+ raise Exception(str(e))
iface = self.bus.get(self.SERVICE, block['path'])
fs = iface[self.SERVICE + '.Encrypted']
fs.Lock({})
@@ -138,7 +144,13 @@ class UDisks2(object):
fs = iface[self.SERVICE + '.Filesystem']
if fs.MountPoints: # partition is mounted
logging.debug(f"Unmounting {block['path']}")
- fs.Unmount({})
+ try:
+ fs.Unmount({})
+ except GLib.GError as e:
+ print(str(e))
+ return False, _("A partition is busy. Try to free it before starting again.")
+ except:
+ raise Exception(str(e))
else:
logging.debug(f"Not mounted {block['path']}")
return True, ""