Merge "Allow CG quota to be showed and updated"
This commit is contained in:
commit
09bfc76c02
cinderclient
@ -498,7 +498,8 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
'snapshots': 1,
|
||||
'gigabytes': 1,
|
||||
'backups': 1,
|
||||
'backup_gigabytes': 1}})
|
||||
'backup_gigabytes': 1,
|
||||
'consistencygroups': 1}})
|
||||
|
||||
def get_os_quota_sets_test_defaults(self):
|
||||
return (200, {}, {'quota_set': {
|
||||
@ -508,7 +509,8 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
'snapshots': 1,
|
||||
'gigabytes': 1,
|
||||
'backups': 1,
|
||||
'backup_gigabytes': 1}})
|
||||
'backup_gigabytes': 1,
|
||||
'consistencygroups': 1}})
|
||||
|
||||
def put_os_quota_sets_test(self, body, **kw):
|
||||
assert list(body) == ['quota_set']
|
||||
@ -521,7 +523,8 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
'snapshots': 2,
|
||||
'gigabytes': 1,
|
||||
'backups': 1,
|
||||
'backup_gigabytes': 1}})
|
||||
'backup_gigabytes': 1,
|
||||
'consistencygroups': 2}})
|
||||
|
||||
def delete_os_quota_sets_1234(self, **kw):
|
||||
return (200, {}, {})
|
||||
@ -541,7 +544,8 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
'snapshots': 1,
|
||||
'gigabytes': 1,
|
||||
'backups': 1,
|
||||
'backup_gigabytes': 1}})
|
||||
'backup_gigabytes': 1,
|
||||
'consistencygroups': 1}})
|
||||
|
||||
def put_os_quota_class_sets_test(self, body, **kw):
|
||||
assert list(body) == ['quota_class_set']
|
||||
@ -554,7 +558,8 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
'snapshots': 2,
|
||||
'gigabytes': 1,
|
||||
'backups': 1,
|
||||
'backup_gigabytes': 1}})
|
||||
'backup_gigabytes': 1,
|
||||
'consistencygroups': 2}})
|
||||
|
||||
#
|
||||
# VolumeTypes
|
||||
|
@ -30,7 +30,8 @@ class QuotaClassSetsTest(utils.TestCase):
|
||||
def test_update_quota(self):
|
||||
q = cs.quota_classes.get('test')
|
||||
q.update(volumes=2, snapshots=2, gigabytes=2000,
|
||||
backups=2, backup_gigabytes=2000)
|
||||
backups=2, backup_gigabytes=2000,
|
||||
consistencygroups=2)
|
||||
cs.assert_called('PUT', '/os-quota-class-sets/test')
|
||||
|
||||
def test_refresh_quota(self):
|
||||
@ -41,6 +42,7 @@ class QuotaClassSetsTest(utils.TestCase):
|
||||
self.assertEqual(q.gigabytes, q2.gigabytes)
|
||||
self.assertEqual(q.backups, q2.backups)
|
||||
self.assertEqual(q.backup_gigabytes, q2.backup_gigabytes)
|
||||
self.assertEqual(q.consistencygroups, q2.consistencygroups)
|
||||
q2.volumes = 0
|
||||
self.assertNotEqual(q.volumes, q2.volumes)
|
||||
q2.snapshots = 0
|
||||
@ -51,9 +53,12 @@ class QuotaClassSetsTest(utils.TestCase):
|
||||
self.assertNotEqual(q.backups, q2.backups)
|
||||
q2.backup_gigabytes = 0
|
||||
self.assertNotEqual(q.backup_gigabytes, q2.backup_gigabytes)
|
||||
q2.consistencygroups = 0
|
||||
self.assertNotEqual(q.consistencygroups, q2.consistencygroups)
|
||||
q2.get()
|
||||
self.assertEqual(q.volumes, q2.volumes)
|
||||
self.assertEqual(q.snapshots, q2.snapshots)
|
||||
self.assertEqual(q.gigabytes, q2.gigabytes)
|
||||
self.assertEqual(q.backups, q2.backups)
|
||||
self.assertEqual(q.backup_gigabytes, q2.backup_gigabytes)
|
||||
self.assertEqual(q.consistencygroups, q2.consistencygroups)
|
||||
|
@ -39,6 +39,7 @@ class QuotaSetsTest(utils.TestCase):
|
||||
q.update(gigabytes=2000)
|
||||
q.update(backups=2)
|
||||
q.update(backup_gigabytes=2000)
|
||||
q.update(consistencygroups=2)
|
||||
cs.assert_called('PUT', '/os-quota-sets/test')
|
||||
|
||||
def test_refresh_quota(self):
|
||||
@ -49,6 +50,7 @@ class QuotaSetsTest(utils.TestCase):
|
||||
self.assertEqual(q.gigabytes, q2.gigabytes)
|
||||
self.assertEqual(q.backups, q2.backups)
|
||||
self.assertEqual(q.backup_gigabytes, q2.backup_gigabytes)
|
||||
self.assertEqual(q.consistencygroups, q2.consistencygroups)
|
||||
q2.volumes = 0
|
||||
self.assertNotEqual(q.volumes, q2.volumes)
|
||||
q2.snapshots = 0
|
||||
@ -59,12 +61,15 @@ class QuotaSetsTest(utils.TestCase):
|
||||
self.assertNotEqual(q.backups, q2.backups)
|
||||
q2.backup_gigabytes = 0
|
||||
self.assertNotEqual(q.backup_gigabytes, q2.backup_gigabytes)
|
||||
q2.consistencygroups = 0
|
||||
self.assertNotEqual(q.consistencygroups, q2.consistencygroups)
|
||||
q2.get()
|
||||
self.assertEqual(q.volumes, q2.volumes)
|
||||
self.assertEqual(q.snapshots, q2.snapshots)
|
||||
self.assertEqual(q.gigabytes, q2.gigabytes)
|
||||
self.assertEqual(q.backups, q2.backups)
|
||||
self.assertEqual(q.backup_gigabytes, q2.backup_gigabytes)
|
||||
self.assertEqual(q.consistencygroups, q2.consistencygroups)
|
||||
|
||||
def test_delete_quota(self):
|
||||
tenant_id = 'test'
|
||||
|
@ -801,7 +801,8 @@ def do_credentials(cs, args):
|
||||
|
||||
|
||||
_quota_resources = ['volumes', 'snapshots', 'gigabytes',
|
||||
'backups', 'backup_gigabytes']
|
||||
'backups', 'backup_gigabytes',
|
||||
'consistencygroups']
|
||||
_quota_infos = ['Type', 'In_use', 'Reserved', 'Limit']
|
||||
|
||||
|
||||
@ -899,6 +900,10 @@ def do_quota_defaults(cs, args):
|
||||
metavar='<backup_gigabytes>',
|
||||
type=int, default=None,
|
||||
help='The new "backup_gigabytes" quota value. Default=None.')
|
||||
@utils.arg('--consistencygroups',
|
||||
metavar='<consistencygroups>',
|
||||
type=int, default=None,
|
||||
help='The new "consistencygroups" quota value. Default=None.')
|
||||
@utils.arg('--volume-type',
|
||||
metavar='<volume_type_name>',
|
||||
default=None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user