Merge "Send resize parameters in rpc as list in the Quobyte driver"

This commit is contained in:
Jenkins 2017-03-09 11:58:29 +00:00 committed by Gerrit Code Review
commit 162e5e606b
3 changed files with 20 additions and 13 deletions

View File

@ -178,10 +178,13 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):
return project_id
def _resize_share(self, share, new_size):
# TODO(kaisers): check and update existing quota if already present
self.rpc.call('setQuota', {"consumer": {"type": 3,
"identifier": share["name"]},
"limits": {"type": 5, "value": new_size}})
self.rpc.call('setQuota', {"quotas": [
{"consumer":
[{"type": "VOLUME",
"identifier": share["name"]}],
"limits": [{"type": "LOGICAL_DISK_SPACE",
"value": new_size}]}
]})
def _resolve_volume_name(self, volume_name, tenant_domain):
"""Resolve a volume name to the global volume uuid."""

View File

@ -394,15 +394,16 @@ class QuobyteShareDriverTestCase(test.TestCase):
self._driver._resize_share(share=self.share, new_size=7)
exp_params = {
"consumer": {
"type": 3,
"identifier": self.share["name"],
},
"limits": {
"type": 5,
"value": 7,
},
}
"quotas": [{
"consumer": [{
"type": "VOLUME",
"identifier": self.share["name"],
}],
"limits": [{
"type": "LOGICAL_DISK_SPACE",
"value": 7,
}],
}]}
self._driver.rpc.call.assert_has_calls([
mock.call('setQuota', exp_params)])

View File

@ -0,0 +1,3 @@
---
fixes:
- Quobyte share extend/shrink operations now work with all Quobyte API versions