class documentation

class DRBD8Info(object):

View In Hierarchy

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

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

Static Method CreateFromFile Undocumented
Static Method CreateFromLines Undocumented
Method __init__ Undocumented
Method GetMinors Return a list of minor for which information is available.
Method GetMinorStatus Undocumented
Method GetVersion Return the DRBD version.
Method GetVersionString Return the DRBD version as a single string.
Method HasMinorStatus Undocumented
Method _JoinLinesPerMinor Transform the raw lines into a dictionary based on the minor.
Method _ParseVersion Undocumented
Constant _VALID_LINE_RE Undocumented
Constant _VERSION_RE Undocumented
Instance Variable _line_per_minor Undocumented
Instance Variable _minors Undocumented
Instance Variable _version Undocumented
@staticmethod
def CreateFromFile(filename=constants.DRBD_STATUS_FILE):

Undocumented

@staticmethod
def CreateFromLines(lines):

Undocumented

def __init__(self, lines):

Undocumented

def GetMinors(self):

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.

def GetMinorStatus(self, minor):

Undocumented

def GetVersion(self):

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_fix_separator (only when k_fix is present)
  • api
  • proto
  • proto2 (only on drbd > 8.2.X)
def GetVersionString(self):

Return the DRBD version as a single string.

def HasMinorStatus(self, minor):

Undocumented

def _JoinLinesPerMinor(self, lines):

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

Returns
a dictionary of minor: joined lines from /proc/drbd for that minor
def _ParseVersion(self, lines):

Undocumented

_VALID_LINE_RE =

Undocumented

Value
re.compile(r'^ *([0-9]+): cs:([^ ]+).*$')
_VERSION_RE =

Undocumented

Value
re.compile(r'^version: (\d+)\.(\d+)\.(\d+)(?:([\.-])(\d+))? \(api:(\d+)/proto:(\
d+)(?:-(\d+))?\)')
_line_per_minor =

Undocumented

_minors =

Undocumented

_version =

Undocumented