'Format a v2 style project list, including marker/limits.'

def format_project_list(self, tenant_refs, **kwargs):

    marker = kwargs.get('marker')
    first_index = 0
    if (marker is not None):
        for (marker_index, tenant) in enumerate(tenant_refs):
            if (tenant['id'] == marker):
                first_index = (marker_index + 1)
                break
        else:
            msg = _('Marker    could    not    be    found')
            raise exception.ValidationError(message=msg)
    limit = kwargs.get('limit')
    last_index = None
    if (limit is not None):
        try:
            limit = int(limit)
            if (limit < 0):
                raise AssertionError()
        except (ValueError, AssertionError):
            msg = _('Invalid    limit    value')
            raise exception.ValidationError(message=msg)
        last_index = (first_index + limit)
    tenant_refs = tenant_refs[first_index:last_index]
    for x in tenant_refs:
        if ('enabled' not in x):
            x['enabled'] = True
    o = {'tenants': tenant_refs, 'tenants_links': []}
    return o
