Commit 445c1b5c authored by Sofia Papagiannaki's avatar Sofia Papagiannaki

pithos: Fix quota limit response

'X-Account-Policy-Quota' header should return the summary of all
the project limits.

Related issue: #250
parent a6a88dcc
......@@ -549,11 +549,12 @@ class ModularBackend(BaseBackend):
path, node = self._lookup_account(account, True)
policy = self._get_policy(node, is_account_policy=True)
if self.using_external_quotaholder:
policy[QUOTA_POLICY] = 0
external_quota = self.astakosclient.service_get_quotas(
account)[account]
policy.update(dict(('%s-%s' % (QUOTA_POLICY, k),
v['pithos.diskspace']['limit']) for k, v in
external_quota.items()))
for k, v in external_quota.items():
policy['%s-%s' % (QUOTA_POLICY, k)] = v['pithos.diskspace']['limit']
policy[QUOTA_POLICY] += v['pithos.diskspace']['limit']
return policy
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment