'Enforce specific constraints of projects that act as domains.
Called when is_domain is true, this method ensures that:
* multiple domains are enabled
* the project name is not the reserved name for a federated domain
* the project is a root project
:raises keystone.exception.ValidationError: If one of the constraints
was not satisfied.'

def _assert_is_domain_project_constraints(self, project_ref):

    if ((not self.identity_api.multiple_domains_supported) and (project_ref['id'] != CONF.identity.default_domain_id)):
        raise exception.ValidationError(message=_('Multiple    domains    are    not    supported'))
    self.assert_domain_not_federated(project_ref['id'], project_ref)
    if project_ref['parent_id']:
        raise exception.ValidationError(message=_('only    root    projects    are    allowed    to    act    as    domains.'))
