コード例 #1
0
ファイル: linux.py プロジェクト: kvick/aminator
 def _unmount(self):
     if mounted(self._mountpoint):
         if busy_mount(self._mountpoint).success:
             raise VolumeException('Unable to unmount {0} from {1}'.format(self._dev, self._mountpoint))
         result = unmount(self._mountpoint)
         if not result.success:
             raise VolumeException('Unable to unmount {0} from {1}: {2}'.format(self._dev, self._mountpoint, result.result.std_err))
コード例 #2
0
ファイル: linux.py プロジェクト: saebyn/aminator
 def _unmount(self):
     if mounted(self._mountpoint):
         if busy_mount(self._mountpoint).success:
             raise VolumeException('Unable to unmount {0} from {1}'.format(self._dev, self._mountpoint))
         result = unmount(self._mountpoint)
         if not result.success:
             raise VolumeException('Unable to unmount {0} from {1}: {2}'.format(self._dev, self._mountpoint,
                                                                                result.result.std_err))
コード例 #3
0
ファイル: linux.py プロジェクト: Netflix/aminator
 def _unmount(self, mountspec):
     recursive_unmount = self.plugin_config.get('recursive_unmount', False)
     if mounted(mountspec):
         result = unmount(mountspec, recursive=recursive_unmount)
         if not result.success:
             err = 'Failed to unmount {0}: {1}'
             err = err.format(mountspec.mountpoint, result.result.std_err)
             open_files = busy_mount(mountspec.mountpoint)
             if open_files.success:
                 err = '{0}. Device has open files:\n{1}'.format(err, open_files.result.std_out)
             raise VolumeException(err)
     log.debug('Unmounted {0.mountpoint}'.format(mountspec))
コード例 #4
0
 def _unmount(self, mountspec):
     recursive_unmount = self.plugin_config.get('recursive_unmount', False)
     if mounted(mountspec):
         result = unmount(mountspec, recursive=recursive_unmount)
         if not result.success:
             err = 'Failed to unmount {0}: {1}'
             err = err.format(mountspec.mountpoint, result.result.std_err)
             open_files = busy_mount(mountspec.mountpoint)
             if open_files.success:
                 err = '{0}. Device has open files:\n{1}'.format(
                     err, open_files.result.std_out)
             raise VolumeException(err)
     log.debug('Unmounted {0.mountpoint}'.format(mountspec))