Package ganeti :: Package cmdlib :: Package cluster :: Module verify :: Class _VerifyErrors
[hide private]
[frames] | no frames]

Class _VerifyErrors

source code


Mix-in for cluster/group verify LUs.

It provides _Error and _ErrorIf, and updates the self.bad boolean. (Expects self.op and self._feedback_fn to be available.)

Instance Methods [hide private]
 
_ErrorMsgList(self, error_descriptor, object_name, message_list, log_type=ETYPE_ERROR)
Format multiple error messages.
source code
 
_ErrorMsg(self, error_descriptor, object_name, message, log_type=ETYPE_ERROR)
Log a single error message.
source code
 
_ErrorIf(self, cond, *args, **kwargs)
Log an error message if the passed condition is True.
source code
 
_Error(self, ecode, item, message, *args, **kwargs)
Log an error message if the passed condition is True.
source code

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

Class Variables [hide private]
  ETYPE_ERROR = constants.CV_ERROR
  ETYPE_WARNING = constants.CV_WARNING
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_ErrorMsgList(self, error_descriptor, object_name, message_list, log_type=ETYPE_ERROR)

source code 

Format multiple error messages.

Based on the opcode's error_codes parameter, either format a parseable error code, or a simpler error string.

This must be called only from Exec and functions called from Exec.

Parameters:
  • error_descriptor (tuple (string, string, string)) - triplet describing the error (object_type, code, description)
  • object_name (string) - name of object (instance, node ..) the error relates to
  • message_list (list of strings) - body of error messages
  • log_type (string) - log message type (WARNING, ERROR ..)