@profiler.trace
@memoized
def tenant_quota_usages(request, tenant_id=None):
 if (not tenant_id):
  tenant_id = request.user.project_id
 disabled_quotas = get_disabled_quotas(request)
 usages = QuotaUsage()
 for quota in get_tenant_quota_data(request, disabled_quotas=disabled_quotas, tenant_id=tenant_id):
  usages.add_quota(quota)
 _get_tenant_compute_usages(request, usages, disabled_quotas, tenant_id)
 _get_tenant_network_usages(request, usages, disabled_quotas, tenant_id)
 _get_tenant_volume_usages(request, usages, disabled_quotas, tenant_id)
 return usages

@ profiler . trace @ memoized def tenant_quota_usages ( request , tenant_id = None ) : if ( not tenant_id ) : tenant_id = request . user . project_id disabled_quotas = get_disabled_quotas ( request ) usages = QuotaUsage ( ) for quota in get_tenant_quota_data ( request , disabled_quotas = disabled_quotas , tenant_id = tenant_id ) : usages . add_quota ( quota ) _get_tenant_compute_usages ( request , usages , disabled_quotas , tenant_id ) _get_tenant_network_usages ( request , usages , disabled_quotas , tenant_id ) _get_tenant_volume_usages ( request , usages , disabled_quotas , tenant_id ) return usages
get our quotas and construct our usage object .