HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
error-mask-info Namespace Reference

Functions

def getErrorMask ()
 
def convertMask (error_mask)
 

Variables

 filename
 
 filemode
 
 logger = logging.getLogger(CONSTS.LOGGER_NAME)
 
string MSG_ERROR_EXIT_STATUS = "Exit failure. "
 
string MSG_DEBUG_INPUT_ERROR_MASK = "Input error mask: "
 
string MSG_DEBUG_CONVERTED_MASKS = "Converted masks: "
 
int STATUS_SUCCESS = 0
 
int STATUS_FAILURE = 1
 
dictionary defined_masks
 
int exit_status = STATUS_SUCCESS
 
def error_mask = getErrorMask()
 
def masks = convertMask(error_mask)
 
 tbi = Utils.getTracebackInfo()
 

Function Documentation

◆ convertMask()

def error-mask-info.convertMask (   error_mask)

Definition at line 115 of file error-mask-info.py.

115 def convertMask(error_mask):
116  founded = False
117  masks = {"errors":[]}
118  logger.debug("defined_masks: %s", str(defined_masks))
119  logger.debug("error_mask: %s", str(type(error_mask)))
120  for key in defined_masks:
121  if defined_masks[key] & error_mask:
122  masks["errors"].append(key)
123  founded = True
124  if founded:
125  logger.debug(MSG_DEBUG_CONVERTED_MASKS + '\n' + str(masks))
126  else:
127  print "Mask " + str(error_mask) + " not defined both CrawlerTask or ProcessorTask"
128  masks = {}
129  return json.dumps(masks)
130 
131 
132 
133 
def convertMask(error_mask)

◆ getErrorMask()

def error-mask-info.getErrorMask ( )

Definition at line 100 of file error-mask-info.py.

100 def getErrorMask():
101  error_mask = None
102  if len(sys.argv) == 2:
103  try:
104  error_mask = int(sys.argv[1])
105  except:
106  print "error mask must be integer"
107  sys.exit(2)
108  else:
109  print "Usage: ./error-mask-info.py <error mask>"
110  sys.exit(2)
111  logger.debug(MSG_DEBUG_INPUT_ERROR_MASK + '\n' + str(error_mask))
112  return error_mask
113 
114 

Variable Documentation

◆ defined_masks

dictionary error-mask-info.defined_masks

Definition at line 38 of file error-mask-info.py.

◆ error_mask

def error-mask-info.error_mask = getErrorMask()

Definition at line 137 of file error-mask-info.py.

◆ exit_status

int error-mask-info.exit_status = STATUS_SUCCESS

Definition at line 136 of file error-mask-info.py.

◆ filemode

error-mask-info.filemode

Definition at line 24 of file error-mask-info.py.

◆ filename

error-mask-info.filename

Definition at line 24 of file error-mask-info.py.

◆ logger

error-mask-info.logger = logging.getLogger(CONSTS.LOGGER_NAME)

Definition at line 25 of file error-mask-info.py.

◆ masks

def error-mask-info.masks = convertMask(error_mask)

Definition at line 138 of file error-mask-info.py.

◆ MSG_DEBUG_CONVERTED_MASKS

string error-mask-info.MSG_DEBUG_CONVERTED_MASKS = "Converted masks: "

Definition at line 32 of file error-mask-info.py.

◆ MSG_DEBUG_INPUT_ERROR_MASK

string error-mask-info.MSG_DEBUG_INPUT_ERROR_MASK = "Input error mask: "

Definition at line 31 of file error-mask-info.py.

◆ MSG_ERROR_EXIT_STATUS

string error-mask-info.MSG_ERROR_EXIT_STATUS = "Exit failure. "

Definition at line 29 of file error-mask-info.py.

◆ STATUS_FAILURE

int error-mask-info.STATUS_FAILURE = 1

Definition at line 36 of file error-mask-info.py.

◆ STATUS_SUCCESS

int error-mask-info.STATUS_SUCCESS = 0

Definition at line 35 of file error-mask-info.py.

◆ tbi

error-mask-info.tbi = Utils.getTracebackInfo()

Definition at line 141 of file error-mask-info.py.