'Called when an entry in a synchronous job has passed verify.  If the
job is ready to run, sets the entries to STARTING. Otherwise, it leaves
them in PENDING.'

def on_pending(self):

    self.set_status(models.HostQueueEntry.Status.PENDING)
    self.host.set_status(models.Host.Status.PENDING)
    self.job.run_if_ready(queue_entry=self)
    if ((self.job.synch_count == 1) and (self.status == models.HostQueueEntry.Status.PENDING)):
        subject = ('Job    %s    (id    %s)' % (self.job.name, self.job.id))
        message = 'Asynchronous    job    stuck    in    Pending'
        mail.manager.enqueue_admin(subject, message)
