'Given a list of resources, retrieve the quotas for the given
tenant. If no limits are found for the specified tenant, the operation
returns the default limits.
:param context: The request context, for access checks.
:param resources: A dictionary of the registered resource keys.
:param tenant_id: The ID of the tenant to return quotas for.
:return: dict from resource name to dict of name and limit'

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

    tenant_quota = dict(((key, resource.default) for (key, resource) in resources.items()))
    quota_objs = quota_obj.Quota.get_objects(context, project_id=tenant_id)
    for item in quota_objs:
        tenant_quota[item['resource']] = item['limit']
    return tenant_quota
