aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2015-11-22 12:27:01 +0100
committerPapoteur <papoteur@mageialinux-online.org>2015-11-22 12:27:01 +0100
commit025b79f33537a671a593a71c129b779b1ed205a5 (patch)
tree69eaf8c9fa66dd97a28aabdb745f41bf5a434c71
parent57ea2dee58369b5ba64987068a8a0ff7840ca47e (diff)
downloadisodumper-025b79f33537a671a593a71c129b779b1ed205a5.tar
isodumper-025b79f33537a671a593a71c129b779b1ed205a5.tar.gz
isodumper-025b79f33537a671a593a71c129b779b1ed205a5.tar.bz2
isodumper-025b79f33537a671a593a71c129b779b1ed205a5.tar.xz
isodumper-025b79f33537a671a593a71c129b779b1ed205a5.zip
Manage when partition is busy (mga#16837)
-rwxr-xr-xlib/isodumper.py43
1 files changed, 25 insertions, 18 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index 24e45e9..477f7da 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -396,6 +396,7 @@ class IsoDumper:
self.success()
def do_write(self, widget):
+ self.returncode = 0
write_button = self.wTree.get_widget("write_button")
write_button.set_sensitive(False)
combo = self.wTree.get_widget("device_combobox")
@@ -428,20 +429,23 @@ class IsoDumper:
self.chooser.set_sensitive(False)
self.do_umount(target)
dialog.hide()
- # Writing step
- #Dump mode
- self.returncode=0
- b=os.path.getsize(source)
- task = self.raw_write(source, target, b)
- gobject.idle_add(task.next)
- while gtk.events_pending():
- gtk.main_iteration(True)
- task = self.check_write(target, b)
- gobject.idle_add(task.next)
- while gtk.events_pending():
- gtk.main_iteration(True)
- if self.returncode == 0:
- self.success()
+ if self.returncode != 1:
+ # Writing step
+ #Dump mode
+ self.returncode=0
+ b=os.path.getsize(source)
+ task = self.raw_write(source, target, b)
+ gobject.idle_add(task.next)
+ while gtk.events_pending():
+ gtk.main_iteration(True)
+ task = self.check_write(target, b)
+ gobject.idle_add(task.next)
+ while gtk.events_pending():
+ gtk.main_iteration(True)
+ if self.returncode == 0:
+ self.success()
+ else:
+ self.restore(widget)
else:
dialog.hide()
combo.set_sensitive(True)
@@ -458,13 +462,16 @@ class IsoDumper:
gtk.main_iteration(True)
try:
retcode = call('umount '+mount[0], shell=True)
- if retcode < 0:
+ if retcode == 32:
+ message = _('Partition %s is busy')%mount[0]
+ self.logger(message)
+ self.emergency()
+ elif retcode< 0:
self.logger(_('Error, umount ')+mount[0]+_(' was terminated by signal ')+str(retcode))
self.emergency()
- else:
- if retcode == 0:
+ elif retcode == 0:
self.logger(mount[0]+_(' successfully unmounted'))
- else:
+ else:
self.logger(_('Error, umount ')+mount[0]+_(' returned ')+str(retcode))
self.emergency()
except OSError, e: