def _validate_storage(self, storage): """Validate the storage model. :param storage: an instance of Blivet :raises: InvalidStorageError if the model is not valid """ report = storage_checker.check(storage) if not report.success: raise InvalidStorageError(" ".join(report.all_errors))
def apply_partitioning(self, module): """Apply a partitioning. :param module: a partitioning module :raise: InvalidStorageError of the partitioning is not valid """ # Validate the partitioning. storage = module.storage.copy() task = StorageValidateTask(storage) report = task.run() if not report.is_valid(): raise InvalidStorageError(" ".join(report.error_messages)) # Apply the partitioning. self._set_storage_playground(storage) self._set_applied_partitioning(module)