From 919db02848e9ee8dd0af4356420adcec62e0b46f Mon Sep 17 00:00:00 2001 From: liyingjun Date: Fri, 7 Jun 2013 11:29:10 +0800 Subject: [PATCH] Add `snapshots` key support for quota class update Fix bug 1188452 Change-Id: I3db0f3f1191a24571de9631786889ee81af777f6 --- cinderclient/tests/v1/test_quota_classes.py | 2 +- cinderclient/tests/v2/test_quota_classes.py | 2 +- cinderclient/v1/quota_classes.py | 2 ++ cinderclient/v2/quota_classes.py | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cinderclient/tests/v1/test_quota_classes.py b/cinderclient/tests/v1/test_quota_classes.py index 33b390df0..83e297fd4 100644 --- a/cinderclient/tests/v1/test_quota_classes.py +++ b/cinderclient/tests/v1/test_quota_classes.py @@ -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): diff --git a/cinderclient/tests/v2/test_quota_classes.py b/cinderclient/tests/v2/test_quota_classes.py index ce7646c99..83cc71022 100644 --- a/cinderclient/tests/v2/test_quota_classes.py +++ b/cinderclient/tests/v2/test_quota_classes.py @@ -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): diff --git a/cinderclient/v1/quota_classes.py b/cinderclient/v1/quota_classes.py index caadd486f..f01ff1d84 100644 --- a/cinderclient/v1/quota_classes.py +++ b/cinderclient/v1/quota_classes.py @@ -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(): diff --git a/cinderclient/v2/quota_classes.py b/cinderclient/v2/quota_classes.py index cc0b75320..c4ab0c51d 100644 --- a/cinderclient/v2/quota_classes.py +++ b/cinderclient/v2/quota_classes.py @@ -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():