'Get a list of all tenants for an admin user.'

@controller.v2_deprecated
def get_all_projects(self, request, **kw):

    self.assert_admin(request)
    name = request.params.get('name')
    if name:
        return self._get_project_by_name(name)
    try:
        tenant_refs = self.resource_api.list_projects_in_domain(CONF.identity.default_domain_id)
    except exception.DomainNotFound:
        tenant_refs = []
    tenant_refs = [self.v3_to_v2_project(tenant_ref) for tenant_ref in tenant_refs if (not tenant_ref.get('is_domain'))]
    params = {'limit': request.params.get('limit'), 'marker': request.params.get('marker')}
    return self.format_project_list(tenant_refs, **params)
