Add snapshots key support for quota class update

Fix bug 1188452

Change-Id: I3db0f3f1191a24571de9631786889ee81af777f6
This commit is contained in:
liyingjun
2013-06-07 11:29:10 +08:00
parent 93557c1929
commit 919db02848
4 changed files with 6 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ class QuotaClassSetsTest(utils.TestCase):
def test_update_quota(self):
q = cs.quota_classes.get('test')
q.update(volumes=2)
q.update(volumes=2, snapshots=2)
cs.assert_called('PUT', '/os-quota-class-sets/test')
def test_refresh_quota(self):

View File

@@ -29,7 +29,7 @@ class QuotaClassSetsTest(utils.TestCase):
def test_update_quota(self):
q = cs.quota_classes.get('test')
q.update(volumes=2)
q.update(volumes=2, snapshots=2)
cs.assert_called('PUT', '/os-quota-class-sets/test')
def test_refresh_quota(self):

View File

@@ -38,11 +38,13 @@ class QuotaClassSetManager(base.Manager):
def update(self,
class_name,
volumes=None,
snapshots=None,
gigabytes=None):
body = {'quota_class_set': {
'class_name': class_name,
'volumes': volumes,
'snapshots': snapshots,
'gigabytes': gigabytes}}
for key in body['quota_class_set'].keys():

View File

@@ -37,11 +37,13 @@ class QuotaClassSetManager(base.Manager):
def update(self,
class_name,
volumes=None,
snapshots=None,
gigabytes=None):
body = {'quota_class_set': {
'class_name': class_name,
'volumes': volumes,
'snapshots': snapshots,
'gigabytes': gigabytes}}
for key in body['quota_class_set'].keys():