diff options
Diffstat (limited to 'backend')
-rwxr-xr-x | backend/magiback | 8 | ||||
-rwxr-xr-x | backend/raw_write.py | 32 |
2 files changed, 0 insertions, 40 deletions
diff --git a/backend/magiback b/backend/magiback index 7deab33..7485773 100755 --- a/backend/magiback +++ b/backend/magiback @@ -23,11 +23,6 @@ class Isodumper(raw_write.Dumper): <arg type='s' name='target' direction='in'/> <arg type='x' name='size' direction='in'/> </method> - <method name='do_unmount'> - <arg type='s' name='device' direction='in'/> - <arg type='b' name='success' direction='out'/> - <arg type='s' name='message' direction='out'/> - </method> <method name='do_format'> <arg type='s' name='device' direction='in'/> <arg type='s' name='format' direction='in'/> @@ -127,9 +122,6 @@ class Isodumper(raw_write.Dumper): def progress(self): return self._progress - def do_unmount(self, device): - return self._do_unmount([device]) - def get_sum(self, source): self.key_thread = threading.Thread(target=self._get_sum, args=(source,)) self.key_thread.start() diff --git a/backend/raw_write.py b/backend/raw_write.py index 87f17a5..cd80b85 100755 --- a/backend/raw_write.py +++ b/backend/raw_write.py @@ -123,38 +123,6 @@ class Dumper(object): logging.debug(self.return_message) return - def _do_unmount(self, target): - target = target[0] - logging.debug("Starting unmounting") - message = _("No partition is mounted.") - retcode = 0 - try: - lines = [line.strip("\n").split(" ") for line in open ("/etc/mtab", "r").readlines()] - mounts = [mount for mount in lines if mount[0].startswith(target)] - except: - message = _('Could not read mtab ! {} {}'.format(os.getuid(),target)) - return False, message - if mounts: - message =_("Unmounting all partitions of {}:\n").format(target) - print(message) - for mount in mounts: - message +=_("Trying to unmount {}...\n").format(mount[0]) - try: - retcode = call('umount '+mount[0], shell=True) - if retcode == 32: - message += _('Partition {} is busy').format(mount[0]) - elif retcode< 0: - message += _('Error, umount {} was terminated by signal {}').format(mount[0],retcode) - elif retcode == 0: - message += _('{} successfully unmounted').format(mount[0]) - else: - message += _('Error, umount returned {}').format(str(retcode)) - except OSError as e: - message += _('Execution failed: {}').format(str(e)) - print(message, file=sys.stderr) - logging.info(message) - return not bool(retcode), message - def _get_sum(self, source): self.return_state = False logging.debug("Starting getting sum") |