def __get_os_domain_by_name(keystone, domain_name):
    """
    Returns the first OpenStack domain with the given name else None
    :param keystone: the Keystone client
    :param domain_name: the domain name to lookup
    :return: the OpenStack domain object
    """
    domains = keystone.domains.list(name=domain_name)
    for domain in domains:
        if domain.name == domain_name:
            return domain