'Get a list of tasks to perform before the host_queue_entry
may be used to run this Job (such as Cleanup & Verify).
:return: A list of tasks to be done to the given queue_entry before
it should be considered be ready to run this job.  The last
task in the list calls HostQueueEntry.on_pending(), which
continues the flow of the job.'

def schedule_pre_job_tasks(self, queue_entry):

    if self._should_run_cleanup(queue_entry):
        task = models.SpecialTask.Task.CLEANUP
    elif self._should_run_verify(queue_entry):
        task = models.SpecialTask.Task.VERIFY
    else:
        queue_entry.on_pending()
        return
    queue_entry = models.HostQueueEntry.objects.get(id=queue_entry.id)
    models.SpecialTask.objects.create(host=models.Host.objects.get(id=queue_entry.host_id), queue_entry=queue_entry, task=task)
