Add cinder backups quota support

Change-Id: If44bb6306a7fee9885cc4616e7ede30b43c1c47a
Closes-Bug: #1621867
This commit is contained in:
Ivan Kolodyazhny 2017-03-07 16:56:57 +02:00
parent 3b4c40389d
commit 6da9bf45ef
2 changed files with 15 additions and 1 deletions

View File

@ -31,6 +31,14 @@ class CinderQuotas(object):
"volumes": {
"type": "integer",
"minimum": -1
},
"backups": {
"type": "integer",
"minimum": -1
},
"backup_gigabytes": {
"type": "integer",
"minimum": -1
}
}
}

View File

@ -27,6 +27,8 @@ class CinderQuotasTestCase(test.TestCase):
quotas_values = {
"volumes": 10,
"snapshots": 50,
"backups": 20,
"backup_gigabytes": 1000,
"gigabytes": 1000
}
cinder_quo.update(tenant_id, **quotas_values)
@ -42,7 +44,11 @@ class CinderQuotasTestCase(test.TestCase):
def test_get(self):
tenant_id = "tenant_id"
quotas = {"gigabytes": "gb", "snapshots": "ss", "volumes": "v"}
quotas = {"gigabytes": "gb",
"snapshots": "ss",
"volumes": "v",
"backups": "b",
"backup_gigabytes": "b_g"}
quota_set = mock.MagicMock(**quotas)
clients = mock.MagicMock()
clients.cinder.return_value.quotas.get.return_value = quota_set