Merge "Add project ID in QuotaDefault requests"

This commit is contained in:
Jenkins 2017-01-24 15:53:29 +00:00 committed by Gerrit Code Review
commit 9e77386c29
2 changed files with 4 additions and 2 deletions

View File

@ -1992,7 +1992,8 @@ class Proxy(proxy2.BaseProxy):
when no resource can be found.
"""
quota_obj = self._get_resource(_quota.Quota, quota)
return self._get(_quota.QuotaDefault, project=quota_obj.project_id)
return self._get(_quota.QuotaDefault, project=quota_obj.id,
requires_id=False)
def quotas(self, **query):
"""Return a generator of quotas

View File

@ -684,7 +684,8 @@ class TestNetworkProxy(test_proxy_base2.TestProxyBase):
self.proxy.get_quota_default,
method_args=['QUOTA_ID'],
expected_args=[quota.QuotaDefault],
expected_kwargs={'project': "PROJECT"})
expected_kwargs={'project': fake_quota.id,
'requires_id': False})
mock_get.assert_called_once_with(quota.Quota, 'QUOTA_ID')
def test_quotas(self):