def _restart(self, my_task):
if not my_task._has_state(Task.WAITING):<EOL><INDENT>raise WorkflowException(my_task, "<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if my_task._get_internal_data('<STR_LIT>') is not None:<EOL><INDENT>if not hasattr(my_task, '<STR_LIT>'):<EOL><INDENT>task_id = my_task._get_internal_data('<STR_LIT>')<EOL>my_task.async_call = default_app.AsyncResult(task_id)<EOL>my_task.deserialized = True<EOL>my_task.async_call.state  <EOL><DEDENT>async_call = my_task.async_call<EOL>if async_call.state == '<STR_LIT>':<EOL><INDENT>pass<EOL><DEDENT>elif async_call.state in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>async_call.revoke()<EOL>LOG.info("<STR_LIT>" % (<EOL>async_call.state, async_call))<EOL><DEDENT>elif async_call.state == '<STR_LIT>':<EOL><INDENT>LOG.warning("<STR_LIT>"<EOL>"<STR_LIT>" % async_call)<EOL><DEDENT>self._clear_celery_task_data(my_task)<EOL><DEDENT>return self._start(my_task)<EOL>
Abort celery task and retry it