summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute
diff options
context:
space:
mode:
authorjiaxi <jiaxi@unitedstack.com>2015-07-17 23:29:50 -0400
committerjiaxi <jiaxi@unitedstack.com>2015-07-28 23:21:28 -0400
commit77214c56e78dff60cdaf8fa2a446fd9658261cbf (patch)
treee5f45622d3379c7cc22d345fe650fd7d46f61599 /openstackclient/tests/compute
parent8175ce5985ae1c9846a8b67ac6abbb2e3ba360e1 (diff)
downloadpython-openstackclient-77214c56e78dff60cdaf8fa2a446fd9658261cbf.tar.gz
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
Diffstat (limited to 'openstackclient/tests/compute')
-rw-r--r--openstackclient/tests/compute/v2/fakes.py18
1 files changed, 18 insertions, 0 deletions
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']