Exemplo n.º 1
0
    def ApplyPartitioning(self, partitioning: ObjPath):
        """Apply the partitioning.

        :param partitioning: a path to a partitioning
        """
        self.implementation.apply_partitioning(
            PartitioningContainer.from_object_path(partitioning))
Exemplo n.º 2
0
    def CreatedPartitioning(self) -> List[ObjPath]:
        """List of all created partitioning modules.

        :return: a list of DBus paths
        """
        return PartitioningContainer.to_object_path_list(
            self.implementation.created_partitioning)
Exemplo n.º 3
0
    def AppliedPartitioning(self) -> ObjPath:
        """The applied partitioning.

        :return: a DBus path or an empty string
        """
        partitioning = self.implementation.applied_partitioning

        if not partitioning:
            return ObjPath("")

        return PartitioningContainer.to_object_path(partitioning)
Exemplo n.º 4
0
    def AppliedPartitioning(self) -> Str:
        """The applied partitioning.

        An empty string is not a valid object path, so
        the return type has to be a string in this case.

        :return: a DBus path or an empty string
        """
        partitioning = self.implementation.applied_partitioning

        if not partitioning:
            return ""

        return PartitioningContainer.to_object_path(partitioning)
Exemplo n.º 5
0
    def CreatePartitioning(self, method: Str) -> ObjPath:
        """Create a new partitioning.

        Allowed values:
            AUTOMATIC
            CUSTOM
            MANUAL
            INTERACTIVE
            BLIVET

        :param method: a partitioning method
        :return: a path to a partitioning
        """
        return PartitioningContainer.to_object_path(
            self.implementation.create_partitioning(
                PartitioningMethod(method)))
Exemplo n.º 6
0
    def ApplyPartitioning(self, partitioning: ObjPath):
        """Apply the partitioning.

        Choose a valid partitioning layout of the specified partitioning
        module for an installation. Call InstallWithTasks to execute the
        scheduled actions and commit these changes to selected disks.

        The device tree module provides information about the partitioned
        storage model instead of the model of the current storage if there
        is an applied partitioning.

        :param partitioning: a path to a partitioning
        :raise: InvalidStorageError if the partitioning is not valid
        """
        self.implementation.apply_partitioning(
            PartitioningContainer.from_object_path(partitioning))
Exemplo n.º 7
0
    def CreatePartitioning(self, method: Str) -> ObjPath:
        """Create a new partitioning.

        Create a new partitioning module with its own copy of the current
        storage model. The partitioning module provides an isolated
        playground for scheduling partitioning actions and validating
        the planned partitioning layout. Once the layout is valid, call
        ApplyPartitioning to choose it for the installation.

        Allowed values:
            AUTOMATIC
            CUSTOM
            MANUAL
            INTERACTIVE
            BLIVET

        :param method: a partitioning method
        :return: a path to a partitioning
        """
        return PartitioningContainer.to_object_path(
            self.implementation.create_partitioning(
                PartitioningMethod(method)))