'Destroys containers via the scheduler'

def _destroy_containers(self, to_destroy):

    if (not to_destroy):
        return
    destroy_threads = [Thread(target=c.destroy) for c in to_destroy]
    [t.start() for t in destroy_threads]
    [t.join() for t in destroy_threads]
    pks = [c.pk for c in to_destroy if (c.state == u'destroyed')]
    Container.objects.filter(pk__in=pks).delete()
    if any(((c.state != u'destroyed') for c in to_destroy)):
        err = u'aborting,    failed    to    destroy    some    containers'
        log_event(self, err, logging.ERROR)
        raise RuntimeError(err)
