Ejemplo n.º 1
0
 def on_failure(self, pythonCommand, result):
     """
 Log some useful information after task failure.
 """
     logger.info("Command " + pprint.pformat(pythonCommand) +
                 " failed with exitcode=" + str(result['exitcode']))
     log_process_information(logger)
Ejemplo n.º 2
0
 def on_failure(self, python_command, result):
     """
 Log some useful information after task failure.
 """
     self.logger.info("Command %s failed with exitcode=%s",
                      pprint.pformat(python_command), result['exitcode'])
     log_process_information(self.logger)
 def cancel_command(self, task_id, reason):
   with self.commands_in_progress_lock:
     if task_id in self.commands_in_progress.keys():
       pid = self.commands_in_progress.get(task_id)
       self.commands_in_progress[task_id] = reason
       logger.info("Canceling command with taskId = {tid}, " \
                   "reason - {reason} . Killing process {pid}"
                   .format(tid=str(task_id), reason=reason, pid=pid))
       log_process_information(logger)
       shell.kill_process_with_children(pid)
     else: 
       logger.warn("Unable to find process associated with taskId = %s" % task_id)