compute: Correct base path for default, detailed quotas
For some reason, you need to include the project ID in the path even though it's wholly ignored. Change-Id: I805cdfaa89134e92eeb9726697925e9d0657af19 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
@@ -2465,7 +2465,8 @@ class Proxy(proxy.Proxy):
|
||||
None,
|
||||
project_id=project.id,
|
||||
)
|
||||
return res.fetch(self, usage=usage, **query)
|
||||
base_path = '/os-quota-sets/%(project_id)s/detail' if usage else None
|
||||
return res.fetch(self, base_path=base_path, **query)
|
||||
|
||||
def get_quota_set_defaults(self, project):
|
||||
"""Show QuotaSet defaults for the project
|
||||
@@ -2484,7 +2485,9 @@ class Proxy(proxy.Proxy):
|
||||
None,
|
||||
project_id=project.id,
|
||||
)
|
||||
return res.fetch(self, base_path='/os-quota-sets/defaults')
|
||||
return res.fetch(
|
||||
self, base_path='/os-quota-sets/%(project_id)s/defaults'
|
||||
)
|
||||
|
||||
def revert_quota_set(self, project, **query):
|
||||
"""Reset Quota for the project/user.
|
||||
|
||||
@@ -125,7 +125,6 @@ class TestQuotas(base.TestCase):
|
||||
'compute',
|
||||
'public',
|
||||
append=['os-quota-sets', project.project_id],
|
||||
qs_elements=['usage=False'],
|
||||
),
|
||||
json={'quota_set': fake_quota_set},
|
||||
),
|
||||
|
||||
@@ -1642,7 +1642,6 @@ class TestQuotaSet(TestComputeProxy):
|
||||
expected_kwargs={
|
||||
'error_message': None,
|
||||
'requires_id': False,
|
||||
'usage': False,
|
||||
},
|
||||
method_result=quota_set.QuotaSet(),
|
||||
expected_result=quota_set.QuotaSet(),
|
||||
@@ -1658,8 +1657,8 @@ class TestQuotaSet(TestComputeProxy):
|
||||
expected_kwargs={
|
||||
'error_message': None,
|
||||
'requires_id': False,
|
||||
'usage': True,
|
||||
'user_id': 'uid',
|
||||
'base_path': '/os-quota-sets/%(project_id)s/detail',
|
||||
},
|
||||
)
|
||||
|
||||
@@ -1672,7 +1671,7 @@ class TestQuotaSet(TestComputeProxy):
|
||||
expected_kwargs={
|
||||
'error_message': None,
|
||||
'requires_id': False,
|
||||
'base_path': '/os-quota-sets/defaults',
|
||||
'base_path': '/os-quota-sets/%(project_id)s/defaults',
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user