From 77214c56e78dff60cdaf8fa2a446fd9658261cbf Mon Sep 17 00:00:00 2001 From: jiaxi Date: Fri, 17 Jul 2015 23:29:50 -0400 Subject: Fix quota set failed problem When using the command: openstack quota set, the compute quota below can't be set successfully,the value of compute quota stay unchanged, 'fixed-ips', 'floating-ips', 'injected-files', 'key-pairs'. What's more,I add a TODO comment in the code for two reason. 1. volume quota set works fine for the moment. 2. To indicate that this issue about volume needs discuss and report another bug, if it's confirmed. This bug is only about compute quota. Change-Id: Ic1028d561f5a0030cf65ac18fc117bf01e945478 Partial-Bug: #1420104 --- openstackclient/tests/compute/v2/fakes.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'openstackclient/tests/compute') diff --git a/openstackclient/tests/compute/v2/fakes.py b/openstackclient/tests/compute/v2/fakes.py index c18dea7e..e798bd40 100644 --- a/openstackclient/tests/compute/v2/fakes.py +++ b/openstackclient/tests/compute/v2/fakes.py @@ -62,6 +62,22 @@ FLAVOR = { 'vcpus': flavor_vcpus, } +floating_ip_num = 100 +fix_ip_num = 100 +injected_file_num = 100 +key_pair_num = 100 +project_name = 'project_test' +QUOTA = { + 'project': project_name, + 'floating-ips': floating_ip_num, + 'fix-ips': fix_ip_num, + 'injected-files': injected_file_num, + 'key-pairs': key_pair_num, +} + +QUOTA_columns = tuple(sorted(QUOTA)) +QUOTA_data = tuple(QUOTA[x] for x in sorted(QUOTA)) + class FakeComputev2Client(object): def __init__(self, **kwargs): @@ -73,6 +89,8 @@ class FakeComputev2Client(object): self.extensions.resource_class = fakes.FakeResource(None, {}) self.flavors = mock.Mock() self.flavors.resource_class = fakes.FakeResource(None, {}) + self.quotas = mock.Mock() + self.quotas.resource_class = fakes.FakeResource(None, {}) self.auth_token = kwargs['token'] self.management_url = kwargs['endpoint'] -- cgit v1.2.1