'Given a list of resources, retrieve the quotas for the all tenants.
:param context: The request context, for access checks.
:param resources: A dictionary of the registered resource keys.
:return: quotas list of dict of tenant_id:, resourcekey1:
resourcekey2: ...'

@staticmethod
@db_api.retry_if_session_inactive()
def get_all_quotas(context, resources):

    tenant_default = dict(((key, resource.default) for (key, resource) in resources.items()))
    all_tenant_quotas = {}
    for quota in quota_obj.Quota.get_objects(context):
        tenant_id = quota['project_id']
        tenant_quota = all_tenant_quotas.get(tenant_id)
        if (tenant_quota is None):
            tenant_quota = tenant_default.copy()
            tenant_quota['tenant_id'] = tenant_id
            attributes.populate_project_info(tenant_quota)
            all_tenant_quotas[tenant_id] = tenant_quota
        tenant_quota[quota['resource']] = quota['limit']
    return list(all_tenant_quotas.values())
