Package ganeti :: Package storage :: Module drbd_info :: Class DRBD8Info
[hide private]
[frames] | no frames]

Class DRBD8Info

source code


Represents information DRBD exports (usually via /proc/drbd).

An instance of this class is created by one of the CreateFrom... methods.

Instance Methods [hide private]
 
__init__(self, lines)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
GetVersion(self)
Return the DRBD version.
source code
 
GetVersionString(self)
Return the DRBD version as a single string.
source code
 
GetMinors(self)
Return a list of minor for which information is available.
source code
 
HasMinorStatus(self, minor) source code
 
GetMinorStatus(self, minor) source code
 
_ParseVersion(self, lines) source code
 
_JoinLinesPerMinor(self, lines)
Transform the raw lines into a dictionary based on the minor.
source code

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

Static Methods [hide private]
 
CreateFromLines(lines) source code
 
CreateFromFile(filename=constants.DRBD_STATUS_FILE) source code
Class Variables [hide private]
  _VERSION_RE = re.compile(r"^version: (\d+)\.(\d+)\.(\d+)" r"(?...
  _VALID_LINE_RE = re.compile("^ *([0-9]+): cs:([^ ]+).*$")
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, lines)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

GetVersion(self)

source code 

Return the DRBD version.

This will return a dict with keys:

  • k_major
  • k_minor
  • k_point
  • k_fix (only on some drbd versions)
  • k_release
  • api
  • proto
  • proto2 (only on drbd > 8.2.X)

GetMinors(self)

source code 

Return a list of minor for which information is available.

This list is ordered in exactly the order which was found in the underlying data.

_JoinLinesPerMinor(self, lines)

source code 

Transform the raw lines into a dictionary based on the minor.

Returns:
a dictionary of minor: joined lines from /proc/drbd for that minor

Class Variable Details [hide private]

_VERSION_RE

Value:
re.compile(r"^version: (\d+)\.(\d+)\.(\d+)" r"(?:\.(\d+))?(?:-(\d+))?"\
 r" \(api:(\d+)/proto:(\d+)(?:-(\d+))?\)")