class documentation

Base class for LVM storage containers.

Method List Returns a list of all entities within the storage unit.
Constant LIST_COMMAND Undocumented
Constant LIST_FIELDS list of tuples consisting of three elements: SF_* constants, lvm command output fields (list), and conversion function or static value (for static value, the lvm output field can be an empty list)
Constant LIST_SEP Undocumented
Class Method _BuildList Builds the final result list.
Static Method _BuildListCommand Builds LVM command line.
Static Method _GetLvmFields Returns unique list of fields wanted from LVM command.
Static Method _RunListCommand Run LVM command.
Static Method _SplitList Splits LVM command output into rows and fields.

Inherited from _Base:

Method Execute Executes an operation on an entity within the storage unit.
Method Modify Modifies an entity within the storage unit.
def List(self, name, wanted_field_names):

Returns a list of all entities within the storage unit.

See _Base.List.

LIST_FIELDS =

list of tuples consisting of three elements: SF_* constants, lvm command output fields (list), and conversion function or static value (for static value, the lvm output field can be an empty list)

Value
None
LIST_SEP: str =

Undocumented

Value
'|'
@classmethod
def _BuildList(cls, cmd_result, fields_def, wanted_field_names, lvm_fields):

Builds the final result list.

Parameters
cmd_result:iterableIterable of LVM command output (iterable of lists)
fields_def:listField definitions
wanted_field_names:listList of requested fields
lvm_fields:listLVM fields
@staticmethod
def _BuildListCommand(cmd, sep, options, name):

Builds LVM command line.

Parameters
cmd:stringCommand name
sep:stringField separator character
options:list of stringsWanted LVM fields
name:name or NoneName of requested entity
@staticmethod
def _GetLvmFields(fields_def, wanted_field_names):

Returns unique list of fields wanted from LVM command.

Parameters
fields_def:listField definitions
wanted_field_names:listList of requested fields
@staticmethod
def _RunListCommand(args):

Run LVM command.

@staticmethod
def _SplitList(data, sep, fieldcount):

Splits LVM command output into rows and fields.

Parameters
data:stringLVM command output
sep:stringField separator character
fieldcount:intExpected number of fields