'Raise HostNotFound if compute host doesn\'t exist.'

def _assert_host_exists(self, context, host_name, must_be_up=False):

    service = objects.Service.get_by_compute_host(context, host_name)
    if (not service):
        raise exception.HostNotFound(host=host_name)
    if (must_be_up and (not self.servicegroup_api.service_is_up(service))):
        raise exception.ComputeServiceUnavailable(host=host_name)
    return service['host']
