Package ganeti :: Package storage :: Module container :: Class _LvmBase
[hide private]
[frames] | no frames]

Class _LvmBase

source code


Base class for LVM storage containers.

Instance Methods [hide private]
 
List(self, name, wanted_field_names)
Returns a list of all entities within the storage unit.
source code

Inherited from _Base: Execute, Modify

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
_BuildList(cls, cmd_result, fields_def, wanted_field_names, lvm_fields)
Builds the final result list.
source code
Static Methods [hide private]
 
_GetLvmFields(fields_def, wanted_field_names)
Returns unique list of fields wanted from LVM command.
source code
 
_BuildListCommand(cmd, sep, options, name)
Builds LVM command line.
source code
 
_RunListCommand(args)
Run LVM command.
source code
 
_SplitList(data, sep, fieldcount)
Splits LVM command output into rows and fields.
source code
Class Variables [hide private]
  LIST_SEP = "|"
  LIST_COMMAND = None
  LIST_FIELDS = None
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)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

List(self, name, wanted_field_names)

source code 

Returns a list of all entities within the storage unit.

See _Base.List.

Parameters:
  • name - Entity name or None for all
  • fields - List with all requested result fields (order is preserved)
Overrides: _Base.List

_GetLvmFields(fields_def, wanted_field_names)
Static Method

source code 

Returns unique list of fields wanted from LVM command.

Parameters:
  • fields_def (list) - Field definitions
  • wanted_field_names (list) - List of requested fields

_BuildList(cls, cmd_result, fields_def, wanted_field_names, lvm_fields)
Class Method

source code 

Builds the final result list.

Parameters:
  • cmd_result (iterable) - Iterable of LVM command output (iterable of lists)
  • fields_def (list) - Field definitions
  • wanted_field_names (list) - List of requested fields
  • lvm_fields (list) - LVM fields

_BuildListCommand(cmd, sep, options, name)
Static Method

source code 

Builds LVM command line.

Parameters:
  • cmd (string) - Command name
  • sep (string) - Field separator character
  • options (list of strings) - Wanted LVM fields
  • name (name or None) - Name of requested entity

_SplitList(data, sep, fieldcount)
Static Method

source code 

Splits LVM command output into rows and fields.

Parameters:
  • data (string) - LVM command output
  • sep (string) - Field separator character
  • fieldcount (int) - Expected number of fields