def resize(self, device, size=None, *short_args, **long_kwds): cmd = (E2FSCK_EXEC, '-fy', device) rcode = filesystems.system(cmd, raise_exc=False, error_text=self.error_messages['fsck'] % device)[2] if rcode not in (0, 1): raise storage2.StorageError('Fsck failed to correct file system errors') cmd = (RESIZE2FS_EXEC, device) filesystems.system(cmd, error_text=self.error_messages['resize'] % device)
def unfreeze(self, device): mpoint = _device_mpoint(device) if mpoint: cmd = (XFS_FREEZE_EXEC, '-u', mpoint) filesystems.system(cmd, error_text=self.error_messages['unfreeze'] % device) else: raise filesystems.FileSystemError( self.error_messages['not_mounted'] % device)
def resize(self, device, size=None, *short_args, **long_kwds): mpoint = _device_mpoint(device) if mpoint: cmd = (XFS_GROWFS_EXEC, mpoint) filesystems.system(cmd, error_text=self.error_messages['resize'] % device) else: raise filesystems.FileSystemError( self.error_messages['not_mounted'] % device)
def get_label(self, device): cmd = (XFS_ADMIN_EXEC, '-l', device) res = re.search( self._label_re, filesystems.system(cmd, error_text=self.error_messages['get_label'] % device)[0]) return res.group('label') if res else ''
def resize(self, device, size=None, *short_args, **long_kwds): cmd = (RESIZE2FS_EXEC, device) filesystems.system(cmd, error_text=self.error_messages['resize'] % device)
def get_label(self, device): cmd = (E2LABEL_EXEC, device) return filesystems.system(cmd, error_text=self.error_messages['get_label'] % device)[0].strip()
def set_label(self, device, label): cmd = (E2LABEL_EXEC, device, label[:MAX_LABEL_LENGTH]) filesystems.system(cmd, error_text=self.error_messages['set_label'] % device)
def unfreeze(self, device): mpoint = self._device_mpoint(device) if mpoint: cmd = (XFS_FREEZE_EXEC, "-u", mpoint) filesystems.system(cmd, error_text=self.error_messages["unfreeze"] % device) raise filesystems.FileSystemError(self.error_messages["not_mounted"] % device)
def get_label(self, device): cmd = (XFS_ADMIN_EXEC, "-l", device) res = re.search( self._label_re, filesystems.system(cmd, error_text=self.error_messages["get_label"] % device)[0] ) return res.group("label") if res else ""
def get_label(self, device): cmd = (XFS_ADMIN_EXEC, '-l', device) res = re.search(self._label_re, filesystems.system( cmd, error_text=self.error_messages['get_label'] % device)[0]) return res.group('label') if res else ''
def set_label(self, device, label): cmd = (XFS_ADMIN_EXEC, '-L', label, device) filesystems.system(cmd, error_text=self.error_messages['set_label'] % device)
def set_label(self, device, label): cmd = (XFS_ADMIN_EXEC, "-L", label, device) filesystems.system(cmd, error_text=self.error_messages["set_label"] % device)