'Creates a host that will be available for a single job run
Internally, a :class:`host <Host>` is created with the :attr:`invalid`
attribute set to True. This way, it will **not** be available to have
jobs queued to it.
:returns: the one time, invalid, :class:`Host`
:rtype: :class:`Host`'

@staticmethod
def create_one_time_host(hostname):

    query = Host.objects.filter(hostname=hostname)
    if (query.count() == 0):
        host = Host(hostname=hostname, invalid=True)
        host.do_validate()
    else:
        host = query[0]
        if (not host.invalid):
            raise model_logic.ValidationError({'hostname': ('%s    already    exists    in    the    autotest    DB.        Select    it    rather    than    entering    it    as    a    one    time    host.' % hostname)})
    host.protection = host_protections.Protection.DO_NOT_REPAIR
    host.locked = False
    host.save()
    host.clean_object()
    return host
