Merge "Allow unprivileged users to get their quota usage"
This commit is contained in:
commit
76e1af8188
@ -61,12 +61,12 @@ def _get_path(resource, id=None, action=None,
|
||||
if action is not None:
|
||||
path = path + '/%s' % action
|
||||
|
||||
if fmt is not None:
|
||||
path = path + '.%s' % fmt
|
||||
|
||||
if endpoint is not None:
|
||||
path = path + '/%s' % endpoint
|
||||
|
||||
if fmt is not None:
|
||||
path = path + '.%s' % fmt
|
||||
|
||||
return path
|
||||
|
||||
|
||||
|
@ -69,8 +69,7 @@ class DetailQuotaExtensionDbTestCase(DetailQuotaExtensionTestCase):
|
||||
|
||||
def test_show_detail_quotas(self):
|
||||
tenant_id = 'tenant_id1'
|
||||
env = {'neutron.context': context.Context('', tenant_id,
|
||||
is_admin=True)}
|
||||
env = {'neutron.context': context.Context('', tenant_id)}
|
||||
res = self.api.get(_get_path('quotas', id=tenant_id,
|
||||
fmt=self.fmt,
|
||||
endpoint=DEFAULT_QUOTAS_ACTION),
|
||||
@ -144,7 +143,7 @@ class DetailQuotaExtensionDbTestCase(DetailQuotaExtensionTestCase):
|
||||
|
||||
def test_detail_quotas_without_admin_forbidden_returns_403(self):
|
||||
tenant_id = 'tenant_id1'
|
||||
env = {'neutron.context': context.Context('', tenant_id,
|
||||
env = {'neutron.context': context.Context('', tenant_id + '2',
|
||||
is_admin=False)}
|
||||
res = self.api.get(_get_path('quotas', id=tenant_id,
|
||||
fmt=self.fmt,
|
||||
|
Loading…
Reference in New Issue
Block a user