'Construct an AgentTask class to run the given SpecialTask and add it
to this dispatcher.
:param special_task: a models.SpecialTask instance
:return: an AgentTask to run this SpecialTask'

def _get_agent_task_for_special_task(self, special_task):

    self._assert_host_has_no_agent(special_task)
    special_agent_task_classes = (CleanupTask, VerifyTask, RepairTask)
    for agent_task_class in special_agent_task_classes:
        if (agent_task_class.TASK_TYPE == special_task.task):
            return agent_task_class(task=special_task)
    raise host_scheduler.SchedulerError('No    AgentTask    class    for    task', str(special_task))
