Callbacks

  UtilsLogFunc (level, msg)
  UtilsProgExtract (line)
  UtilsProgFunc (task_id, status, completion, msg)

Details

BlockDev.UtilsLogFunc(level, msg)
Parameters:
  • level (int) – log level (as understood by syslog(3))
  • msg (str) – log message

Function type for logging function used by the libblockdev’s exec utils to log the information about program executing.

BlockDev.UtilsProgExtract(line)
Parameters:line (str) – line from extract progress from
Returns:whether the line was a progress reporting line or not
completion:percentage of completion
Return type:(bool, completion: int)
BlockDev.UtilsProgFunc(task_id, status, completion, msg)
Parameters:
  • task_id (int) – ID of the task/action the progress is reported for
  • status (BlockDev.UtilsProgStatus) – progress status
  • completion (int) – percentage of completion
  • msg (str or None) – arbitrary progress message (for the user)