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 task = StorageValidateTask(storage) task.run() # Apply the partitioning. self.set_storage(storage.copy()) log.debug("Applied the partitioning %s.", module)
def apply_partitioning(self, object_path): """Apply a partitioning. :param object_path: an object path of a partitioning module :raise: InvalidStorageError of the partitioning is not valid """ # Get the partitioning module. module = self._partitioning_modules.get(object_path) if not module: raise ValueError("Unknown partitioning {}.".format(object_path)) # Validate the partitioning. storage = module.storage task = StorageValidateTask(storage) task.run() # Apply the partitioning. self.set_storage(storage.copy()) log.debug("Applied the partitioning from %s.", object_path)
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)